Displaying 1 result from an estimated 1 matches for "sd_data3".
Did you mean:
sc_data
2005 May 02
1
newbie ifelse matrix question
...ried searching the manual and user list and countless changes to the syntax over the last week, but no luck so far.
Here is my syntax and error
> data1<-read.table("testR_data",na.string="0.000000")
> dim(data1)
[1] 20 204
# Find sd of rows, then multiply * 3
> sd_data3<-apply(data1[,5:204],1,sd,na.rm=TRUE)*3
# Attach sd_data3 to data1
> sd_and_data1<-cbind(sd_data3,data1)
# Replace values >= 3 SDs with NA
> sd_and_data1[,6:205]<-ifelse(abs(sd_and_data1[,6:205])<=sd_and_data1[,1],sd_and_data1[,6:205], NA)
Warning message:
provided 4000 variab...