Help with uploaded data "Error in sort(x) : object 'variable1' not found"

Hello everyone,

I am new in the Rstudio program and I have some difficulties. I used the button "importing data" and the selection "from stata" and then I used a code to convert my data to numeric. I can see my data in the tab "environment" (data).

I want to make a plot [plot(ecdf(variable1))] but this message comes up:
Error in sort(x) : object 'earnmCDF' not found.

Please, is there anyone can help me understand what to do after uploading the data in order to be able to use my dataset?

Thanks in advance

what did you name your dataset in R ?
(be careful with spelling and capitalisation.)
if you can see it in your environment then you can reference it in your plot code.
its weird that your claimed plot code does not 'agree' with your reported error.
The error implies you referenced an earnmCDF object.
your plot code implies you are directly mentioning a variable without stipulating which object its within. so I would have expected an error saying variable1 not found.

Thank you very much for your response!

I named "Book3" my dataset in R.

"earnmCDF" is the name of the variable I want to examine.I used the following command (and not the command: [plot(ecdf(variable1))], which was a copy/paste mistake):

and then this message came up:
Error in sort(x) : object 'earnmCDF' not found.

In order Rstudio to be able to run my dataset should I write:
If I do this then this message comes up:

Error: Can't subset columns that don't exist.
x The locations 558, 972, 490, 1056, 391, etc. don't exist.
i There are only 9 columns.
Run rlang::last_error() to see where the error occurred.

Thank you again
Best regards,


Think of the dollar symbol as picking out a column from a table

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