jop96
April 4, 2020, 5:09pm
1
Hello R experts,
I'm trying to run this code to plot a scatterplot:
ggscatter(Correlation, x = "AverageTemperature", y = "Confirmed",
add = "reg.line", conf.int = TRUE,
cor.coef = TRUE, cor.method = "pearson",
xlab = "AverageTemperature", ylab = "Confirmed")
The dataset im working with looks somthing like this:
Country Confirmed Deaths Recovered Date AverageTemperature AverageTemperatureUncertainty
1 Afghanistan 281 6 10 2013-08-01 26.031 0.347
2 Albania 304 17 89 2013-08-01 24.793 0.928
3 Algeria 1171 105 62 2013-08-01 33.234 0.798
Now I would like to only include the cases which have 500 or more ''confirmed'' cases. Im new to R and have no clue whatsoever on how to achieve this. I've tried adding filter (n > 500) but I get the following error:
Error in n > 500 :
comparison (6) is possible only for atomic and list types
Would love an answer!
Kind regards,
Jop
Hi!
To help us help you, could you please prepare a repr oducible ex ample (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:
A minimal reproducible example consists of the following items:
A minimal dataset, necessary to reproduce the issue
The minimal runnable code necessary to reproduce the issue, which can be run
on the given dataset, and including the necessary information on the used packages.
Let's quickly go over each one of these with examples:
Minimal Dataset (Sample Data)
You need to provide a data frame that is small enough to be (reasonably) pasted on a post, but big enough to reproduce your issue.
Let's say, as an example, that you are working with the iris data frame
head(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.…
system
Closed
April 25, 2020, 5:14pm
3
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.