search for: cbi_tot

Displaying 1 result from an estimated 1 matches for "cbi_tot".

2011 Feb 09
2
nested ifelse problem
...NA NA 3.020202 NA 3.040506 3.040506 1.836547 1.659729 1.203959 2.401184 3.020202 NA NA NA 2.069177 1.870625 1.768595 2.989593 NA NA NA NA 2.046985 1.203959 1.203959 NA NA NA NA NA 1.469238 NA 1.278849 NA NA NA NA NA I want to create a new column (fd$cbi_tot) that is an average of some of the other columns (chosen based on the conditions as indicated in the code below). ifelse(is.na(fd$cbi_C) & is.na(fd$cbi_D) & is.na(fd$cbi_E) & is.na(fd$cbi_F) & is.na(fd$cbi_B1) & !is.na(fd$cbi_B2), cbi_totlist <- cbind(fd$cbi_A, fd$cbi_B2),...