Hi!
I have a question concerning data frames and changing particular values in it.
I have set up a data frame containing n rows of observations od dimension m, so in
each row there is a vector of size m. Now I want to introduce a cut off to tha data.
Therfore I caluclated the mean and variance within each column using apply:
me<-apply(daten[1:72],2,mean)
st<-apply(daten[1:72],2,var)
Now I want use the mean and the var to form a cut off value, and apply it to each row
of the data frame.
I tried the following
cutoff<-function(x){
if(x>me+2*st){
x<-me+2*st
}
}
cutd<-apply(daten[1:72],1,cutoff)
but I have to supply somehow the column index to me and st.
Any Ideas ?
Thanks,
Frank
--
Frank G. Zoellner
AG Angewandte Informatik
Technische Fakult"at
Universit"at Bielefeld
phone: +49(0)521-106-2951
fax: +49(0)521-106-2992
email: [EMAIL PROTECTED]
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html