[R] counting strings in a column

2009-02-19 Thread Nattu
Dear All,

I have a query : what is the command to count number of repeated words in a
column.

for ex:

a =

oranges
oranges
apples
apples
grape
oranges
apple
pine


the result should be
oranges 3
apples  3
grape 1
pine 1

is there an easy way for this.

Thanks,
Nataraju
GM R   D
Bangalore

-- 
No relationship is Static .. You either Step up or Step down

[[alternative HTML version deleted]]

__
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.


Re: [R] counting strings in a column

2009-02-19 Thread jim holtman
?table

On Thu, Feb 19, 2009 at 11:48 AM, Nattu natar...@gmail.com wrote:
 Dear All,

 I have a query : what is the command to count number of repeated words in a
 column.

 for ex:

 a =

 oranges
 oranges
 apples
 apples
 grape
 oranges
 apple
 pine


 the result should be
 oranges 3
 apples  3
 grape 1
 pine 1

 is there an easy way for this.

 Thanks,
 Nataraju
 GM R   D
 Bangalore

 --
 No relationship is Static .. You either Step up or Step down

[[alternative HTML version deleted]]

 __
 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.




-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

__
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.