Why is it saying it can't find my variable "bodywt" ?

I can't understand why this table viz won't plot. The code seems correct, and the packages are installed/opened. The file was uploaded properly, and I can see the dataframe for "monkeys_info" in another window - so I know the csv file uploaded properly and the data can be accessed by the editor.... And even though its saying that it can't find my variable "bodywt" I can see it at the top of the column in the viewing window inside the editor pane....

Any ideas what I am doing wrong here? Code and error code immediately below. THANKS!!

ggplot(data = monkeys_info) +
geom_point(mapping = aes(x = Brainwt, y = bodywt))

Error in geom_point():
! Problem while computing aesthetics.
:information_source: Error occurred in the 1st layer.
Caused by error in FUN():
! object 'bodywt' not found
Run rlang::last_trace() to see where the error occurred.

Try to put a reproducible example of data with this way;

This error is when you try to call with other name of column, please check the correct form of write it

For see the columns names, try :

names(monkeys_info) #show the names of each columns.

Next verify and try with ggplot2 library.

THANK YOU. You were right. The problem was with the column names. I think maybe the issue derived from the fact that the first column was actually untitled in the data set and then the frame too. So I cleaned up the column names.... and that fixed the problem. Thank you very much! Have a great day/night!

1 Like

This topic was automatically closed 42 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.