I would try fininterval as well. It should do what you have asked provided
that you take care of the issue Ulrik pointed out.
Best of luck--EK
On Fri, Sep 8, 2017 at 6:15 AM, Hemant Sain wrote:
> i have a vector containing values ranging from 0 to 24
> i want to create another variable which can
Hi Hemant,
please write to the r-help list in the future.
Look at the cut () function to solve your problem.
Also, you have a problem in your example - 5 is placed in two different
categories.
HTH
Ulrik
On Fri, 8 Sep 2017 at 12:16 Hemant Sain wrote:
> i have a vector containing values rangin
go through R intro document (chapter 2 and chapter 9).
You probably could find answer yourself quicker then waiting for me to answer
it.
Regards
Petr
From: staysafe23 [mailto:staysaf...@gmail.com]
Sent: Thursday, February 07, 2013 9:09 PM
To: PIKAL Petr
Subject: RE: [R] Nested loop and output help
ch cycle you assign whole
vector oo1 to dev1.
Is it intended?
Regards
Petr
From: staysafe23 [mailto:staysaf...@gmail.com]
Sent: Friday, February 01, 2013 10:12 PM
To: PIKAL Petr
Cc: r-help@r-project.org
Subject: RE: [R] Nested loop and output help
Thank you very much Petr,
I believe I have fixed m
Dear R help moderator,
My name is Thomas and I am new here. I am wondering if my post violated
some of the rules of posting here. If so can you please let me know what I
have done so that I can repost? I reread the posting guidelines and don't
see anything that I violate. I have been reading a gre
Thank you very much Petr,
I believe I have fixed my inquiry to not use floating points in my cycle as
you pointed out and to use the list structure to keep my results. I am
still at a loss as to how to run the multiple loops. I have tried quite a
few different strategies but my failure seems to il
Hi
see inline
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of staysafe23
> Sent: Friday, February 01, 2013 1:01 AM
> To: r-help@r-project.org
> Subject: [R] Nested loop and output help
>
> Hello Everyone,
>
> My name is Tho
eric()
for (i in 1:length(data.aux$Pma)){
result.aux[i] <-sum(data.aux$SBA2[which(data.aux$dbh2> data.aux[i ,
]$dbh2)]) }
data$BAL2[ index.stand]<-result.aux
rm(data.aux)
rm(result.aux)
}
data
Best,
Paloma
> Date: Thu, 21 Jul 2011 14:18:37 -0700
Hi:
I *think* this is what you're after, but I get dizzy trying to read
convoluted loops. Try this instead;
# Function to find the total SBA2 for all dbh2 larger than the given one:
foo <- function(d) {
d <- d[order(d$dbh2), ]
d <- transform(d, BAL2 = sum(SBA2) - cumsum(SBA2))
d
}
9 matches
Mail list logo