Skip to content

apply with missing values

3 messages · jenna, Jessica Streicher, David Winsemius

#
I am trying to get the means of each participants avg saccade amplitude as a
function of the group they were in (designated by "shape_"), but there are
missing values in the dataset....this is what i tried...

with(data055,tapply(AVERAGE_SACCADE_AMPLITUDE,shape_,mean))
i get an error saying the argument is not numerical or logical

next i try...
+ data055$shape_,mean, na.rm =TRUE)

still nothing....

help? thanks!



--
View this message in context: http://r.789695.n4.nabble.com/apply-with-missing-values-tp4653889.html
Sent from the R help mailing list archive at Nabble.com.
#
A bit of data might be useful. Make a small example and post the data with dput().
On 24.12.2012, at 20:21, jenna wrote:

            
#
On Dec 24, 2012, at 11:21 AM, jenna wrote:

            
The error message appears informative (and would NOT be expected to be  
solved by adding na.rm=TRUE). Your construction of the data055  
dataframe was flawed in some way. You have not shown how it was done  
nor given dput(head(data055)) which would have provided a basis for  
further assessment. Based on past experience my guess is that there  
was a character value in the column of data you thought was numeric  
during a read.* operation and is now a factor.