requires you to choose.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: Sarah Goslee [mailto:sarah.gos...@gmail.com]
> Sent: Friday, February 24, 2012 9:39 AM
> To: William Dunlap
> Cc: Arnaud Gaboury; r-help@r-project.org
> Subject: Re: [
Whatever makes you happy.
> df1 <-
+ structure(list(x = structure(c(1L, 2L, 2L, 3L), .Label = c("AA",
+ "BB", "CC"), class = "factor"), y = 1:4), .Names = c("x", "y"
+ ), row.names = c(NA, -4L), class = "data.frame")
> mult <- c("AA"=2,"BB"=5,"CC"=1,"DD"=2)
> df1$y * mult[df1$x]
AA BB BB CC
2 10
=
"data.frame")
Have a good weekend.
Arnaud Gaboury
A2CT2 Ltd.
Trade: +41 22 849 88 63
Fax: +41 22 849 88 66
arnaud.gabo...@a2ct2.com
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are address
90
>
> Bill Dunlap
> Spotfire, TIBCO Software
> wdunlap tibco.com
>
>> -Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
>> Behalf Of Arnaud Gaboury
>> Sent: Friday, February 24, 2012 8:37 AM
>> To: U
> >
> > In fact I was trying to do something with apply in one line, but couldn't
> > achieve any result. In
> fact, all my transformation will be multiplying one object by a specific
> number according to the value
> of df$x.
>
> In that case:
>
> m
r the use of the individual or entity to whom they are addressed.
Access to this email by anyone else is unauthorized. If you are not the
intended recipient, any disclosure, copying, distribution or any action taken
or omitted to be taken in reliance on it, is prohibited and may be unlawful. If
yo
ting. Feel free to ignore my post if you think I am lazy and disrespectful
to the list.
Arnaud Gaboury
A2CT2 Ltd.
-----Original Message-
From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de]
Sent: vendredi 24 février 2012 17:41
To: Arnaud Gaboury
Cc: r-help@r-project.org
Subject:
---> if df$x==BB, df$y<-2*25
> 3 CC 3 NOTHING
> 4 AA 40 > if df$x==AA, df$y<-4*10
> 5 DD 75 > if df$x==DD, df$y<-5*15
> 6 DD 90 > if df$x==DD, df$y<-6*15
>
> Arnaud Gaboury
>
> A2CT2 Ltd.
>
> -Original Message-
==DD, df$y<-6*15
Arnaud Gaboury
A2CT2 Ltd.
-Original Message-
From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de]
Sent: vendredi 24 février 2012 17:07
To: Arnaud Gaboury
Cc: r-help@r-project.org
Subject: Re: [R] data frame manipulation with condition
On 24.02.2012 16:59, Arnaud
5 DD 75 > if df$x==DD, df$y<-5*15
6 DD 90 > if df$x==DD, df$y<-6*15
Arnaud Gaboury
A2CT2 Ltd.
-Original Message-
From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de]
Sent: vendredi 24 février 2012 17:07
To: Arnaud Gaboury
Cc: r-help@r-project.org
Subject: Re
2CT2 Ltd.
>>
>>
>> -Original Message-
>> From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de]
>> Sent: vendredi 24 février 2012 16:33
>> To: Arnaud Gaboury
>> Cc: r-help@r-project.org
>> Subject: Re: [R] data frame manipulation
boury
Cc: r-help@r-project.org
Subject: Re: [R] data frame manipulation with condition
On 24.02.2012 16:25, Arnaud Gaboury wrote:
Dear list,
n00b question, but still can't find any easy answer.
Here is a df:
Change
df<-data.frame(cbind(x=c("AA","BB","CC&q
boury
A2CT2 Ltd.
-Original Message-
From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de]
Sent: vendredi 24 février 2012 16:33
To: Arnaud Gaboury
Cc: r-help@r-project.org
Subject: Re: [R] data frame manipulation with condition
On 24.02.2012 16:25, Arnaud Gaboury wrote:
> D
On 24.02.2012 16:25, Arnaud Gaboury wrote:
Dear list,
n00b question, but still can't find any easy answer.
Here is a df:
Change
df<-data.frame(cbind(x=c("AA","BB","CC","AA"),y=1:4))
to
df <- data.frame(x = c("AA","BB","CC","AA"), y = 1:4)
to make your object a sensible data.frame.
14 matches
Mail list logo