R Studio can't find y


This keeps happening and I even tried using the code straight from STHDA, but it still gives me this error message. Please send help.

I would check to see if x and y actually exist. Perhaps the data function doesn't have the right arguments?

I have a working boxplot with the same data, but it doesn't recognize it now for some reason

I would suggest putting something like
head(y)
head(x)

right in the code that you posted to be sure that x and y are actually there. Of course, it's quite possible that they are there and the problem is something else.

I tried that and it still says that y is missing

Does the head(y) statement print some of the values of y?

Nope, nothing has shown

Then the problem is that the data statement isn't working.

One possibility is that the file name needs to be in quotes.

That didn't work. What is another possiblity?

I haven't used data(), so others may give you better advice. But...

  1. Try just data() which should list the data sets it can find. See if the one you want is listed.
  2. I believe data() wants just the filename, not the particular variable such as time.

I redid my data, I even did data.entry and put in random numbers, but it still didn't recognize y

It would be better if you showed exactly the code you used and the results to be sure everyone is on the same page. Perhaps use reprex, as in FAQ: What's a reproducible example (`reprex`) and how do I create one?

I figured it out, I was using the wrong code for the wrong program. Thank you for your help.

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.