;,x)))
> res3<-within(as.data.frame(res2),{Freq<-as.numeric(Freq)})
> head(res3)
> # Var1 Freq
> #1 0-51
> #2 5-106
> #3 10-152
> #4 15-202
> #5 20-256
> #6 25-302
>
>
> A.K.
>
>
>
>
>
>
>
>
> - Orig
s.numeric(Freq)})
head(res3)
# Var1 Freq
#1 0-5 1
#2 5-10 6
#3 10-15 2
#4 15-20 2
#5 20-25 6
#6 25-30 2
A.K.
- Original Message -
From: jcrosbie
To: r-help@r-project.org
Cc:
Sent: Tuesday, October 16, 2012 7:37 PM
Subject: [R] frequency table with custom bands
-30 2
A.K.
- Original Message -
From: jim holtman
To: jcrosbie
Cc: r-help@r-project.org
Sent: Tuesday, October 16, 2012 8:52 PM
Subject: Re: [R] frequency table with custom bands
?cut
try this:
> seq1 = seq(0, 95, by = 5)
> seq2 = seq(100, 1000, by = 100)
> Band
?cut
try this:
> seq1 = seq(0, 95, by = 5)
> seq2 = seq(100, 1000, by = 100)
> Bands = c(seq1, seq2)
> Prices = sample(1:1000, 200, replace=F)
> table(cut(Prices, breaks = Bands))
(0,5] (5,10] (10,15] (15,20] (20,25]
(25,30] (30,35] (35,40]
1 2
I would like to create a frequency table with custom bands.
seq1 = seq(0, 100, by = 5)
seq2 = seq(100, 1000, by = 100)
Bands = c(seq1, seq2)
Prices = sample(1:1000, 200, replace=F)
How would I go about find the frequency of prices within each band?
--
View this message in context:
http:/
5 matches
Mail list logo