datacarpentry / r-socialsci

R for Social Scientists
https://datacarpentry.org/r-socialsci/
Other
111 stars 199 forks source link

Wrong use of concept "object" #516

Closed cknuepfer closed 5 days ago

cknuepfer commented 4 weeks ago

In episode 2 "Introduction to R" there are many places with phrases like this:

Assign values to objects in R

There seem to be an misconception here! In R everything is an object (see the famous quote from the book "Extending R" by John M. Chambers: "Everything that exists in R is an object"). This means in an assignment like

x <- 1

x is an object (a variable), 1 is an object (a value), <- is (the name of) an object (a function). And the whole expression is also an object. So the formulation "Assign values to objects in R" is very misleading. It should be "Assign values to variables in R". Or, as phrased in the help to <- "Assign a value to a name."

juanfung commented 3 weeks ago

@cknuepfer very true. and thank you for the suggested edit "Assign values to variables in R."

would you be interested in submitting a PR with this change?