So I'm working through a multivariate analysis for a project and trying to familiarize myself with R as I do so, and I keep getting the error
Warning message:
In mean.default(Complete_measurements[4]) :
argument is not numeric or logical: returning NA
I'm not using 'mean.default' anywhere, but I have tracked the specific location to just my mean(complete_measurements[4])
I've noticed that when I instead use mean(Complete_measurements$High Freq (Hz)
) it seems to work fine, but since I'm intending to use an array of data (ie columns 4-11), I was wondering if there was an easy solution to do so?
Thanks in advance!
So I've tried and gotten:
> mean(Complete_measurements$`High Freq (Hz)`)
[1] 6689.791
> mean(Complete_measurements[4])
[1] NA
Warning message:
In mean.default(Complete_measurements[4]) :
argument is not numeric or logical: returning NA
I expected to get the same result for both? So the 6689.791, but I'm not sure why I get the error instead
Edit: while I get an answer when using '''mean(Complete_measurements[[4]])''', it gives me a different one - any reason why?