alent to your recorded data, and w is your
desired output? Comments would be helpful. Then why can't you use this
method to process your own data?
Sarah
>
> Thank you
> Chris
>
>
>
> - Original Message -
> From: Sarah Goslee
> To: Christopher Kelvin ; r-help
; Chris
>
>
>
>
>
>
>
> - Original Message -
> From: Sarah Goslee
> To: Christopher Kelvin ; r-help
>
> Cc:
> Sent: Thursday, May 31, 2012 3:51 AM
> Subject: Re: [R] problem with ifelse
>
> Since your code has things like this:
> z<-
> The code below is used to generate interval censored data but unfortunately
> there is an
> error with the ifelse which i am not able to rectify.
> Can somebody help correct it for me.
Not quickly.
But cut() might do a large part of what you need with a
Since your code has things like this:
z<-numeric(length(t ((
either you have a serious problem with your email client or you need
to reread some introductory material and take a hard look at your
code.
Also note that g() doesn't work, because it contains the statement
return(m) but m is undefined
Hi,
The error with ifelse() seems to be that you have no idea what ifelse() does.
As far as I can tell, you tried to construct code that does something like this:
y<-function(tdata,v){
z <- rep(NA, length(tdata))
s <- z
for(i in 1:length(tdata)) {
for(j in 1:length(v-1)) {
Dear all,
The code below is used to generate interval censored data but unfortunately
there is an error with the ifelse which i am not able to rectify.
Can somebody help correct it for me.
Thank you
t<-rexp(20,0.2)
v<-c(0,m,999)
y<-function(t,v){
z<-numeric(length(t ((
s<-numeric(leng
un...@r-project.org] Im
Auftrag von Mark Na
Gesendet: Tuesday, June 23, 2009 6:33 PM
An: r-help@r-project.org
Betreff: [R] Problem with ifelse statement
Hi R-helpers,
I am trying to use this ifelse statement to recode a variable:
> data$SOCIAL_STATUS<-ifelse(data$SOCIAL_STATUS=="B&qu
Notice what happens in your 'ifelse': any row that does not meet the
condition is changed to "B"; that is probably not what you were expecting.
You probably want:
data$SOCIAL_STATUS<-ifelse(data$SOCIAL_STATUS=="B" & data$MALE>4, "C",
data$SOCIAL_STATUS)
so you leave the others unchanged.
On Tu
Hi R-helpers,
I am trying to use this ifelse statement to recode a variable:
> data$SOCIAL_STATUS<-ifelse(data$SOCIAL_STATUS=="B" & data$MALE>4, "C", "B")
(i.e., if social status is B and there are more than 4 males, then
recode social status to C; otherwise, leave it B)
But, it's not working. S
9 matches
Mail list logo