son
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Kevin
> Wamae
> Sent: 21 February 2018 20:34
> To: R-help@r-project.org
> Subject: [R] alternative for multiple if_else statements
>
> Hi, I
Wamae
> Sent: 21 February 2018 20:34
> To: R-help@r-project.org
> Subject: [R] alternative for multiple if_else statements
>
> Hi, I am having trouble trying to figure out why if_else is behaving the way
> it is,
> it may be my code or the way the data is structured.
>
>
elp@r-project.org"
Subject: Re: [R] alternative for multiple if_else statements
Hi Kevin,
I ran the code on the full data set and was able to reproduce the problem that
you are facing.
My guess is that you have an error in your intuition and/or logic, and that
this relates to the use of the
Dear Ista, thank you. Let me see how best I can implement this.
Regards
--
Kevin Wamae
On 22/02/2018, 16:58, "Ista Zahn" wrote:
I don't fully understand the logic you are trying to implement, but
something along the lines of
foo <- cut(trialData$date,
I don't fully understand the logic you are trying to implement, but
something along the lines of
foo <- cut(trialData$date,
breaks = as.Date(c("2007-01-01",
"2008-05-01",
"2009-04-01",
"2010-05-01"
y_start
> == "Y" & trialData$year == 2013 & trialData$site == "site_1"][1] &
> trialData$date < trialData$date[trialData$month == 4 & trialData$year ==
> 2014 & trialData$site == "site_1"][1]] <- "survey_2013"
>
>
>
&
Hi,
1. I think the reason that the different ordering leads to different
results is because of the following:
date[ some condition is true ][1]
will give you an NA if there are no rows where 'some condition holds'.
In the code that 'works' you don't have such a situation, but in the
cod
Hi, I am having trouble trying to figure out why if_else is behaving the way it
is, it may be my code or the way the data is structured.
Below is a snapshot of a database am working on and it represents a
longitudinal survey of study participants in a trial with weekly follow up.
The variable "
8 matches
Mail list logo