'Error message - why does it say "object not found"?
I'm very new to R and stackoverflow, so I apologize ahead of time if I'm breaking any etiquette somehow.
I have only typed a few lines of code so far, following a book tutorial. The book is Statistical Modeling: A Fresh Approach, printed in 2012, so I'm not sure what version of R it has. I am using R 4.0.0.
All I have written so far is:
cherryBlossom2008 <- read.csv("Cherry-Blossom-2008.csv")
names(cherryBlossom2008)
this produces:
[1] "position" "division" "total" "name" "age" "place" "net" "gun" "sex"
Next I typed:
mean(age, data=cherryBlossom2008)
I immediately get an error message that says:
Error in mean(age, data = cherryBlossom2008) : object 'age' not found
I'm not sure how this is possible. 'age' is in cherryBlossom2008. My book says that I would get that error message if I failed to define "data" when using the "mean" command, but as you can see I did define "data", so I don't understand how else I would define 'age'.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
