Re: [R] count by category

2015-10-06 Thread Jim Lemon
Hi Val, You can even get a graphic illustration of this quite easily: library(plotrix) sizetree(dataset) Jim On Tue, Oct 6, 2015 at 10:00 AM, Val wrote: > Hi All, > > I have a data set ( region, city, town and district). The data looks like > region, city, town, district > 1 1 1 1 > 1 1

Re: [R] count by category

2015-10-06 Thread Thierry Onkelinx
er solutions but I would use ave with length function > for each column separately to add new column. > > See ?ave > > Cheers > Petr > > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Val > > Sent: Tuesday, Octob

Re: [R] count by category

2015-10-05 Thread PIKAL Petr
M > To: r-help@r-project.org > Subject: [R] count by category > > Hi All, > > I have a data set ( region, city, town and district). The data looks > like region, city, town, district > 1 1 1 1 > 1 1 1 2 > 1 1 1 3 > 1 1 2 1 > 1 1 2 2 > 1 2 1

[R] count by category

2015-10-05 Thread Val
Hi All, I have a data set ( region, city, town and district). The data looks like region, city, town, district 1 1 1 1 1 1 1 2 1 1 1 3 1 1 2 1 1 1 2 2 1 2 1 1 I want the counts for region, city and town. Here region 1 has 6 records, city 1 has 5 records and city 2 has 1 re