Try this:
2 * (DF == "+") - (DF != "-")
On Thu, Apr 16, 2009 at 2:58 PM, Juergen Rose wrote:
> The second beginner question. I want to create a new dataframe, where
> each element of the original dataframe is translated to 1 if it was "+",
> to 0 if it was "-" to -1 otherwise. I could do with:
Am Donnerstag, den 16.04.2009, 15:14 -0400 schrieb Chuck Cleland:
> On 4/16/2009 2:58 PM, Juergen Rose wrote:
> > The second beginner question. I want to create a new dataframe, where
> > each element of the original dataframe is translated to 1 if it was "+",
> > to 0 if it was "-" to -1 otherwise
On 4/16/2009 2:58 PM, Juergen Rose wrote:
> The second beginner question. I want to create a new dataframe, where
> each element of the original dataframe is translated to 1 if it was "+",
> to 0 if it was "-" to -1 otherwise. I could do with:
>
> Lines <- "abcd
> +-+ +
>
3 matches
Mail list logo