[R] abbreviate

From: Omar Lakkis <uofiowa_at_gmail.com>
Date: Thu 16 Jun 2005 - 03:59:46 EST


> p = data.frame(high=c(5,2), settle=c(3,4))
> p

  high settle

1    5      3
2    2      4

What is the most abbreviated way to apply: if (p$high < p$settle) p$high = p$settle

I want to modify p to become:
> p


  high settle

1    5      3
2    4      4

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 16 04:22:52 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:42 EST