ginal Message-
>>> From: R-help [mailto:r-help-boun...@r-project.org
<mailto:r-help-boun...@r-project.org>] On Behalf Of Duncan
>>> Murdoch
>>> Sent: Monday, October 26, 2015 11:58 AM
>>> To: Lorenz, Jennifer; r-help@r-project.org <mailto:r-help@r-project.org
g>] On Behalf Of Duncan
>>> Murdoch
>>> Sent: Monday, October 26, 2015 11:58 AM
>>> To: Lorenz, Jennifer; r-help@r-project.org <mailto:r-help@r-project.org>
>>> Subject: Re: [R] Creating new variables in R
>>>
>>> On 26/10/2015 6:24 A
gt; To: Lorenz, Jennifer; r-help@r-project.org <mailto:r-help@r-project.org>
>> Subject: Re: [R] Creating new variables in R
>>
>> On 26/10/2015 6:24 AM, Lorenz, Jennifer wrote:
>>> Hi,
>>>
>>> I have a question regarding the creation of ne
Hi
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan
> Murdoch
> Sent: Monday, October 26, 2015 11:58 AM
> To: Lorenz, Jennifer; r-help@r-project.org
> Subject: Re: [R] Creating new variables in R
>
> On 26/10/2015 6
On 26/10/2015 6:24 AM, Lorenz, Jennifer wrote:
> Hi,
>
> I have a question regarding the creation of new variables on the basis of
> existing ones in R.
>
> I have two variables containing information on parents' educational degree
> (e.g. 1 'high school degree', 2 'college degree', etc.). I w
Hi,
I have a question regarding the creation of new variables on the basis of
existing ones in R.
I have two variables containing information on parents' educational degree
(e.g. 1 'high school degree', 2 'college degree', etc.). I would like to create
a new variable for 'parents' highest edu
Many thanks for the info
Nick Riches
On 28 February 2011 12:05, Sarah Goslee wrote:
> Hi Nick,
>
> You want:
> cbind(mydataframe, newvar)
>
> and possibly also a quick read of one of the intro to R documents available
> online.
>
> Sarah
>
> On Mon, Feb 28, 2011 at 6:55 AM, Nick Riches
> wrote
Hi Nick,
You want:
cbind(mydataframe, newvar)
and possibly also a quick read of one of the intro to R documents available
online.
Sarah
On Mon, Feb 28, 2011 at 6:55 AM, Nick Riches wrote:
> Hi
>
> I'm an R newbie. I can't seem to add new variables to data frames. Here are
> the stages
>
> (1)
Hi
I'm an R newbie. I can't seem to add new variables to data frames. Here are
the stages
(1) I import the data using read.csv.
(2) I fix it using fix(data)
(3) I create a new variable using
spos<-tagPOS(stim,language="en",model=NULL,tagdict=NULL).
(tagPOS is a function in the OpenNLP toolkit, w
On Oct 10, 2009, at 7:49 PM, Ashta wrote:
Thanks. This helps. How do I generate P?
Will this work?
p1<-pnorm(mean=0, std=1)
p2<-pnorm(mean=0, std=1)
Seems unlikely. You are not supplying sufficient arguments for the
pnorm function for one thing. For another I suspect you really want
the r
you will have to specify what 'x' is. I am not sure what you are
trying to do with the variables you have not defined.
Sent from my iPhone
On Oct 10, 2009, at 19:49, Ashta wrote:
> Thanks. This helps. How do I generate P?
> Will this work?
>
> p1<-pnorm(mean=0, std=1)
> p2<-pnorm(mean=0, std
Thanks. This helps. How do I generate P?
Will this work?
p1<-pnorm(mean=0, std=1)
p2<-pnorm(mean=0, std=1)
x <- cbind(x, v1=ifelse(x[,'p'] > 0.4, 1, 0), v2=ifelse(x[,'2'] > 0.6, 0,
1))
If the 'data set' is a dataframe, the following will work:
x$v1 <- ifelse(x$p > 0.4, 1, 0)
x$v2 <- ifelse
If the 'data set' is a dataframe, the following will work:
x$v1 <- ifelse(x$p > 0.4, 1, 0)
x$v2 <- ifelse(x$p > 0.6, 1, 0)
If it is matrix, try
x <- cbind(x, v1=ifelse(x[,'p'] > 0.4, 1, 0), v2=ifelse(x[,'p'] > 0.6, 1, 2))
If helps a lot if you follow the posting rules and provide commented,
mi
Hi all,
I have a data set called x with200 rows and 12 columns. I want
create two more columns based on probability. ie
if p >0 .4 then v1 =1 else v1=0;
if p >0 .6 then v2 =1 else v2=0;
Finally x will have 14 variables.
Can any one show me how to do that?
Thanks
Ashta
.
14 matches
Mail list logo