I am new to R, so please forgive my ignorance before hand.
I have a dataset that looks like this. jetleg.dat being my dataset.
treatment phaseshift
control 0.53
control 0.36
light -0.78
light -0.86
I need to get the mean for treatment and phaseshift.
When I do the calculation,
control <- jetlag.dat[jetlag.dat$treatment == 'control',]$percent
light <- jetlag.dat[jetlag.dat$treatment == 'light',]$percent
mean(control)
mean(light)
I get this notification:
Warning message: In mean.default(control) : argument is not numeric or logical: returning NA
I understand that control and light are non numeric, but I thought I accounted for that in calculation. I have done this before like this and it worked. Any help would be appreciated. Thank you.