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 |
lee.ad...@luminant.com | 214.875.8737 Office | 214.701.0687 Mobile

-----Original Message-----
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Zoppoli, Gabriele (NIH/NCI) [G]
Sent: Thursday, April 22, 2010 12:37 PM
To: r-help@r-project.org
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: zoppo...@mail.nih.gov
______________________________________________
R-help@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.


Confidentiality Notice: This email message, including an...{{dropped:10}}

______________________________________________
R-help@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.

Reply via email to