I am having a terrible time trying to figure this one out. Tried a bunch of techniques/functions and so far nothing working for me and having a tough time understanding why not...
I have a data frame that has the following format:
Place May Jun July Aug Sep Oct
Placename1 11.1 12.5 13.6 18.9 23.10 34.7
Etc...
Place is a factor, the numerics are type double.
What I need is a column added of the mean of the monthly values for each place, like:
Place Mean
Placename1 18.98
Nothing I've done has worked to calculate the mean PER row and add to the data frame. Like I tried this:
place_df1$means <- rowMeans(place_df1)
which didn't work. Error returned:
Error in rowMeans(county_temp) : 'x' must be numeric
and I've tried literally ten different other ways, using apply, etc. Tearing what's left of my hair out. :)
Any clue on what I'm doing wrong is appreciated.
Thanks!