[R] Calculate mean ignore null

Jeffrey Joh johjeffrey at hotmail.com
Tue Aug 2 23:47:51 CEST 2011


I have the following: 

Tout = c(".    ", ".    ", 
+ "-51.0", " -9.6", " -9.6", " -9.6", " -9.6", " -9.6", " -9.6", 
+ " -9.6", " -9.5", " -9.5", " -9.6", " -9.5", " -9.6", " -9.6", 
+ " -9.5", " -9.4", " -9.3", " -9.3", " -9.3", " -9.2", " -9.0", 
+ " -9.0", " -8.9", " -8.9", " -8.9")

 

How can I take the mean while ignoring the null values?  I don't want to delete the ".    ", just ignore.  na.rm=TRUE does not work for this.


Jeffrey 		 	   		  


More information about the R-help mailing list