Hi all, I'm new to R and i'm wanting to create a bivariate visualisation of two continuous variables using a box plot as part of a University assignment:
This is the code that i am using:
ggplot(data = na.omit(A1), mapping = aes(x = worryx, y = antisoctotal)) +
geom_boxplot()
This comes up with a blank box so i was told to add
data = subset(A1, !is.na(worryx))
- as data is missing from more than one variable in worry variable
so its:
ggplot(data = subset(A1, !is.na(worryx)), mapping = aes(x = worryx, y = antisoctotal)) + geom_boxplot()
however when i run this, this error message appears:
Error in if (is.double(data$x) && !has_groups(data) && any(data$x != data$x[1L])) { :
missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(diff(sort(x))) : no non-missing arguments to min; returning Inf
Can anyone help with this? I've tried googling the answer and even tried the package plotly but that throws up even more errors.
Thanks in advance!