Thanks to all who responded, particularly to Michael. Your solution was the
easiest to understand & to implement.
This worked beautifully:
cmtot <- arrange(cmtot, -PCTTOT)#sort by descending
top <- with(cmtot,which.max(cumsum(PCTTOT) >= 50))
topcm <- cmtot[seq(1,top),]
--
View this message
Hello,
In R you would use vectorized instructions, not a do while loop.
dat <- read.table(text="
client pct_total
A 15%
B 10%
C 10%
D 9%
E 8%
F 6%
G 4%
", header = TRUE)
# Make it numeric
dat$pct_total <- with(dat, as.numeric(su
Have your read an Introduction to R? If not, do so before posting
further. There are also many "R for SAS users" tutorials on the web
I'm sure. Google or check CRAN. In particular, you need to understand
how indexing works. See ?"[" and ?subset
You will certainly have to define what you mean by "j
On Tue, Sep 18, 2012 at 3:41 PM, ramoss wrote:
> Hello,
>
> I am a newbie to R coming from SAS background. I am trying to program the
> following:
> I have a monthly data frame with 2 variables:
>
> client pct_total
> A 15%
> B 10%
> C 10%
> D 9%
> E
Hello,
I am a newbie to R coming from SAS background. I am trying to program the
following:
I have a monthly data frame with 2 variables:
client pct_total
A 15%
B 10%
C 10%
D 9%
E 8%
F 6%
G 4%
I need to come up w/ a monthly list o
5 matches
Mail list logo