Hi, I keep getting the following error message when I run this code and I do not know why. Please could someone suggest a solution to rectify this? Thanks in advance.
is a data frame. But the mean function expects a vector of values. It looks like you are trying to do something like the following. The code below returns a data frame with one row and one column:
Another possibility is to use the pull function to get a vector of values from a data column, which you can then run mean on directly. For example, the code below return a vector with one value (the mean of the "pulled" data):