On Jul 31, 2009, at 2:55 PM, PDXRugger wrote:
I must apoligize, as i want clear of what i wanted to occur. i dont
want to
count the occurences but rather recode them. I am trying to replace
all of
the values with the new coded values in Person_CAT. SO NP <- c(1,
1, 2,
1, 1, 2, 2,
I must apoligize, as i want clear of what i wanted to occur. i dont want to
count the occurences but rather recode them. I am trying to replace all of
the values with the new coded values in Person_CAT. SO NP <- c(1, 1, 2,
1, 1, 2, 2, 1, 4, 1, 0, 5,
+ 3, 3, 1, 5, 3, 5, 1, 6, 1,
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
Here is a suggestion:
> Per <- c("NA", "1", "2", "3","4")
> NP <- c(1, 1, 2, 1, 1, 2, 2, 1, 4, 1, 0, 5,
+ 3, 3, 1, 5, 3, 5, 1, 6, 1, 2, 2, 2,
+ 4, 4, 1, 2, 1, 3, 3, 1, 2, 2, 1, 2, 1, 2,
+ 2, 3, 1, 1, 4, 4, 1, 1, 1, 2, 2, 2)
> Person_CAT <- cut(NP, breaks = c(0:4, Inf)-0.5, labe
4 matches
Mail list logo