thanks Rainer,
it worked!
> From: rainer.schuerm...@gmx.net
> To: r-help@r-project.org; fin_e...@hotmail.com
> Subject: Re: [R] for/if loop in R
> Date: Fri, 22 Jul 2011 03:23:19 +0200
>
> For me, this works:
>
> > Now, I want to add a 4th column, trend
> priceda
For me, this works:
> Now, I want to add a 4th column, trend
pricedata$trend <- 0
> which can have 2 values 0 or 1. if return>1%, trend=1 else trend=0.
pricedata$trend <- ifelse( pricedata$return > .01, 1, 0 )
Rgds,
Rainer
On Thursday 21 July 2011 19:39:15 financial engineer wrote:
>
> hi,
>
2 matches
Mail list logo