Displaying 1 result from an estimated 1 matches for "cut50".
2009 Sep 22
1
cut and re-factor data
...Hmisc
>count
[1] 10 20 20 50 50 50 50 50 50 50 50 50 50 50 10 20 20
>age_bucket <- seq (0,80,5)
>age_f <- factor(age_bucket)
> age_f
[1] 0 10 15 20 25 30 35 40 45 5 50 55 60 65 70 75 80
Levels: 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80
ct <- rep(age_bucket, count)
cut50 <- cut2(ct,m=50)
levels(cut50)
[1] "[ 0,15)" "15" "20" "25" "30" "35" "40"
"45" "[50,75]"
Now I want to map age_f levels 1, 2 and 3 to cut50 level 1 on the data frame
of count...