Gabriele -
How about this:
> data<-c("A","A","A","B","B","C","D")
> data
[1] "A" "A" "A" "B" "B" "C" "D"
> table(data)
data
A B C D
3 2 1 1
Thanks,
Lee
". . . people who focus only on 'what is' will create more of 'what is.'
People who focus mostly on 'what could be' will begin to create 'what
could be.'" ~ Laura Beth Jones
Lee P. Adams | Fuel & Emissions Strategy | Luminant Energy |
[email protected] | 214.875.8737 Office | 214.701.0687 Mobile
-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Zoppoli, Gabriele (NIH/NCI) [G]
Sent: Thursday, April 22, 2010 12:37 PM
To: [email protected]
Subject: [R] simple question
Hi
how can I find, in a vector of characters, which is the most frequent
one?
Thanks
Gabriele Zoppoli, MD
Ph.D. Fellow, Experimental and Clinical Oncology and Hematology,
University of Genova, Genova, Italy
Guest Researcher, LMP, NCI, NIH, Bethesda MD
Work: 301-451-8575
Mobile: 301-204-5642
Email: [email protected]
______________________________________________
[email protected] 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.
Confidentiality Notice: This email message, including an...{{dropped:10}}
______________________________________________
[email protected] 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.