[R] Vertical subtraction in dataframes

nowfocus averyhaviv at hotmail.com
Sat Mar 13 02:18:20 CET 2010


It depends how you stored your missing values.  If they are listed as NAs
then

mydataframe$calib <- Count - is.na(stain)*Count
or 
mydataframe$calib <- Count*(1 - is.na(stain))

The trick is the boolean 'TRUE' equals 1 in numeric calculations.
-- 
View this message in context: http://n4.nabble.com/Vertical-subtraction-in-dataframes-tp1591223p1591351.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list