Re: [R] how to handle NA values in aggregate()

2012-12-15 Thread arun
44.1 14.5   0.304 A.K. - Original Message - From: Yao He To: r-help@r-project.org Cc: Sent: Saturday, December 15, 2012 10:44 PM Subject: [R] how to handle NA values in aggregate() Dear All: I am trying to calculate four columns' means in a dataframe like this: FID  MID   

Re: [R] how to handle NA values in aggregate()

2012-12-15 Thread arun
(x,na.rm=T)) #  Group.1 EW_INCU EW_17.5  EMW EEratio #1   1    46.6    44.1 14.5   0.304 #2   2    50.5    48.0 15.4   0.320 - Original Message - From: Yao He To: r-help@r-project.org Cc: Sent: Saturday, December 15, 2012 10:44 PM Subject: [R] how to handle NA values in aggre

Re: [R] how to handle NA values in aggregate()

2012-12-15 Thread Anthony Damico
check the help file. ?aggregate says that it ignores missing values by default ;) df <- read.table( header = TRUE , text = "FID MID IID EW_INCU EW_17.5 EMWEEratio 1 4621 TWF2H545.26NA 15.61 NA 1 4621 TWF2H648.0244.09

[R] how to handle NA values in aggregate()

2012-12-15 Thread Yao He
Dear All: I am trying to calculate four columns' means in a dataframe like this: FID MID IID EW_INCU EW_17.5 EMWEEratio 1 4621 TWF2H545.26NA 15.61 NA 1 4621 TWF2H648.0244.09 13.41 0.3041506 2 4630 TWF2H19 5