Hi Kai,
How about setting:
germlinepatients$DisclosureStatus <- NA
then having your three conditional statements as indices:
germlinepatients$DisclosureStatus[germlinepatients$gl_resultsdisclosed
== 1] <-"DISCLOSED"
germlinepatients$DisclosureStatus[germlinepatients$
gl_resultsdisclosed == 0] <-
Hello List,
I wrote the script below to assign value to a new field DisclosureStatus.
my goal is if gl_resultsdisclosed=1 then DisclosureStatus=DISCLOSED
else if gl_resultsdisclosed=0 then DisclosureStatus= ATTEMPTED
else if gl_resultsdisclosed is missing and gl_discloseattempt1 is not missing
the
This is probably far more discussion than the question warranted, but...
On Thu, Dec 3, 2009 at 11:14 PM, David Winsemius wrote:
>
> On Dec 3, 2009, at 10:52 PM, Gray Calhoun wrote:
>
>> The data import/export manual can elaborate on a lot of these; this is
>> all straightforward, although many p
On Thu, Dec 3, 2009 at 9:52 PM, John Filben wrote:
> Can R support data manipulation programming that is available in the SAS
> datastep? Specifically, can R support the following:
> - Read multiple dataset one record at a time and compare values from
> each; then base on if-then logic
On Dec 3, 2009, at 10:52 PM, Gray Calhoun wrote:
The data import/export manual can elaborate on a lot of these; this is
all straightforward, although many people would prefer to use a
relational database for some of the things you mentioned.
See Wickham's pithy response to this.
I'm not
awa
The data import/export manual can elaborate on a lot of these; this is
all straightforward, although many people would prefer to use a
relational database for some of the things you mentioned. I'm not
aware of a "goto" command in R, though (although I could be wrong).
--Gray
On Thu, Dec 3, 2009 a
Please refrain from posting HTML. The results can be incomprehensible:
On 2009.12.03 13:52:09, John Filben wrote:
> Can R support data manipulation programming that is available in the SAS
> datastep??? Specifically, can R support the following:
> -?? Read multiple dataset one rec
On Thu, Dec 3, 2009 at 3:52 PM, John Filben wrote:
> Can R support data manipulation programming that is available in the SAS
> datastep? Specifically, can R support the following:
> - Read multiple dataset one record at a time and compare values from
> each; then base on if-then logic
Can R support data manipulation programming that is available in the SAS
datastep? Specifically, can R support the following:
-Â Â Â Â Â Â Â Â Â Read multiple dataset one record at a time and compare
values from each; then base on if-then logic write to multiple output files
-Â Â Â Â Â Â Â Â Â
dles some special cases outside my small example dataset.
Thank you again!
Peter.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of bartjoosen
Sent: 6. november 2008 11:31
To: r-help@r-project.org
Subject: Re: [R] Data manipulation question
How about:
id
How about:
id <- c(rep("a",4),rep("b",2), rep("c",5), rep("d",1))
start <- c(c(0,6,17,20),c(0,1),c(0,5,10,11,50),c(0))
stop <- c(c(6,12,20,30),c(1,10),c(3,10,11,30,55),c(6))
data <- data.frame(id,start,stop)
f <- function(data){
m <- match(data$start,data$stop) + 1
if (length
On Thu, Nov 6, 2008 at 4:23 PM, Peter Jepsen <[EMAIL PROTECTED]> wrote:
>
> Here is an example:
>
> id <- c(rep("a",4),rep("b",2), rep("c",5), rep("d",1))
> start <- c(c(0,6,17,20),c(0,1),c(0,5,10,11,50),c(0))
> stop <- c(c(6,12,20,30),c(1,10),c(3,10,11,30,55),c(6))
> data <- as.data.frame(cbind(id
Dear R-listers,
I am a relatively inexperienced R-user currently migrating from Stata. I
am deeply frustrated by this data manipulation question: I know how I
could do it in Stata, but I cannot make it work in R.
I have a data frame of hospitalization data where each row represents an
admission.
Michael Denslow <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Dear R users,
>
> I am a new user (probably obvious by my question) and
> have really learned a lot from reading this list.
> Thank you all very much. My main struggles with R are
> with data manipulation.
>
> So here is my
Try this:
rep(x[[1]], x[[2]])
On 27/01/2008, Michael Denslow <[EMAIL PROTECTED]> wrote:
> Dear R users,
>
> I am a new user (probably obvious by my question) and
> have really learned a lot from reading this list.
> Thank you all very much. My main struggles with R are
> with data manipulation.
Dear R users,
I am a new user (probably obvious by my question) and
have really learned a lot from reading this list.
Thank you all very much. My main struggles with R are
with data manipulation.
So here is my question...
I have data that is organized as below, this is a
short example.
value
Try this:
transform(d, z = y[match(x, id)])
On 10/10/07, Julien Barnier <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Suppose I have the following data.frame, with an id column and two
> variables columns :
>
> idX Y
> 0001 NA 21
> 0002 NA 13
> 0003 000145
>
Hi all,
Suppose I have the following data.frame, with an id column and two
variables columns :
idX Y
0001 NA 21
0002 NA 13
0003 000145
0004 NA 71
0005 000320
What I would like to do is to create a new variable Z whose values are
the Y
18 matches
Mail list logo