I'm super confused as to how to find the mean of "object1" and really need help. here's a screenshot. I can't find anything online really and can't find help.
Asked
Active
Viewed 65 times
-1
-
1Some of your rmarkdown code blocks are using three single-quotes `'''` for code-fences, those are incorrect. It needs three backticks `\`\`\`` instead. – r2evans Sep 23 '21 at 18:29
-
Got it! I changed that. My teacher said to use mean (dat$object1) and I just tried it and it didn't work... is there something I need to add to it? Like backticks? – Gracie Hobby Sep 23 '21 at 18:38
-
2*"It didn't work"* says nothing. Did it emit a warning or error? Did R or your operating system crash? Did the neighborhood lights dim? The *picture* (not good) of your data suggests that it is named `mydata` and not `dat`. Welcome to SO, Gracie Hobby! Please learn how to make questions a bit more reproducible by including sample data and code you've attempted; see https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info for good discussion. Also, no pictures of data please, just *real data* (https://meta.stackoverflow.com/a/285557). – r2evans Sep 23 '21 at 18:54
-
Please provide enough code so others can better understand or reproduce the problem. – Community Sep 25 '21 at 01:36
1 Answers
0
dat$object1
refers to a column named object1
in a data frame named dat
. Judging from the picture, you don't have a data frame named dat
. However, you do have a column named object1
in your data frame. You need to change the first part of dat$object1
, to make it refer to your data frame. Once you have made that change, you can put it inside mean()
.

rjen
- 1,938
- 1
- 7
- 19