I made thi function in R and everything wroks fine:
test<-function (x){
ma <-apply(x,2,max)
mi <-apply(x,2,min)
x2 <-data.frame(x)
for (i in 1:length(ma))
x2[,i] <- ifelse(x2[,i]==ma[i],"max",ifelse(x2[,i]==mi[i],"min","FALSE"))
print (x2)
}
What should I do if I would make the same adding the information in a new data frame? How can I add new columns automatically?
Thanks a lot