Newbie to R in need of Box Plot Help

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!

Hi!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.