Re: [R] truncating values into separate categories

2009-08-01 Thread David Winsemius
n_CAT NA 1 2 3 4 1 19 15 6 9 You should be aware, though, that items corresponding to the level "NA" will NOT be treated as missing. Bill Venables http://www.cmis.csiro.au/bill.venables/ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...

Re: [R] truncating values into separate categories

2009-08-01 Thread PDXRugger
"NA" > will NOT be treated as missing. > > > Bill Venables > http://www.cmis.csiro.au/bill.venables/ > > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of PDXRugger > Sent: Friday,

Re: [R] truncating values into separate categories

2009-07-31 Thread Albyn Jones
It appears that your difficulty lies in miscounting the number of intervals. cut(NP, breaks=c(0,1,2,3,4,max(NP))) [1] (0,1] (0,1] (1,2] (0,1] (0,1] (1,2] (1,2] (0,1] (3,4] (0,1] (4,6] (2,3] (2,3] (0,1] [16] (4,6] (2,3] (4,6] (0,1] (4,6] (0,1] (1,2] (1,2] (1,2] (3,4] (3,4] (0,1] (1,2] (0,1

Re: [R] truncating values into separate categories

2009-07-30 Thread Bill.Venables
ww.cmis.csiro.au/bill.venables/ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of PDXRugger Sent: Friday, 31 July 2009 9:54 AM To: r-help@r-project.org Subject: [R] truncating values into separate categories Hi all, Simple questio

[R] truncating values into separate categories

2009-07-30 Thread PDXRugger
Hi all, Simple question which i thought i had the answer but it isnt so simple for some reason. I am sure someone can easily help. I would like to categorize the values in NP into 1 of the five values in "Per", with the last category("4") representing values >=4(hence 4:max(NP)). The problem