[R] Find max of a row in data frame (like Excel)

From: Anh Tran <popophobia_at_gmail.com>
Date: Tue, 24 Jun 2008 15:41:52 -0700


Hi,
Here's the data we have:

> rs[1:5,]

        probe_id f1 f2 f3 f4 M A f

1 A_68_P20002076  2 58  0  0 1.51778114 6.344453 59
2 A_68_P20002775 22  8 15  0 0.43419304 5.488819 59
3 A_68_P20005791 43  3  0  0 0.05698666 9.830594 59
4 A_68_P20005805 11 34  0  0 1.71076835 6.624038 59
5 A_68_P20006729 16 44  0  0 0.85498261 6.044229 59

I want rs$f be the max of f1, f2, f3, f4 like a function in excel (=max(f1, f2, f3, f4)).

How should we do it in R? I'm not familiar with programing with list. So please be patient
 Thanks

-- 
Regards,
Anh Tran

	[[alternative HTML version deleted]]

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 24 Jun 2008 - 22:48:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 25 Jun 2008 - 21:31:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive