Hello, I am new to learning R (mostly through datacamp) and it appears the dataset I'm trying to work with is loaded correctly. It is a .csv file with variable names as the columns and data for each participant in each row. Each column is an item from a scale (e.g. SEAT1-SEAT24, RSE1-RSE10). I'm a psychologist and created a scale with my psych testing class in the spring. I'm also much more used to programs like SPSS, JASP, and JAMOVI, so this has been challenging.
I'll try to include screen capture, but the data set looks like this....
I attempted to sum the SEAT items by entering (for example)
sum(SEAT1, SEAT2, SEAT3)
and I get back an error stating that the object 'seat1' is not found. When I call up variable names it lists all of the 60 columns for the different variables I have. So its all in there.
I'm sure I'm missing something and appreciate any thoughts you may have. Thank you!!
I would usually reshape the data to have a column describing the variable and a column for the value. Nevertheless, here are some ways to sum an entire data frame or a subset of the columns.
Hi @ericphd! Yours is a common situation. You might find these articles, examples, and books helpful, since they're aimed directly at people trying to translate their prior experience with other statistical software into R terms: http://r4stats.com/
We also have a whole thread on this site where people chimed in with their favorite resources for people new to R: