Petr wrote:
>
>> Hi
>>
>> -Original Message-
>>> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
>>> project.org] On Behalf Of Arnaud Michel
>>> Sent: Wednesday, December 11, 2013 2:01 PM
>>> To: R help
>>> Subject:
On 13-12-11 8:22 AM, PIKAL Petr wrote:
Hi
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Arnaud Michel
Sent: Wednesday, December 11, 2013 2:01 PM
To: R help
Subject: [R] To transform a vector of qualitatives values into a
Hi
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Arnaud Michel
> Sent: Wednesday, December 11, 2013 2:01 PM
> To: R help
> Subject: [R] To transform a vector of qualitatives values into a
> dataframe of
Hi
From the vector
X <- c(A, A, B, C, B, A, C)
I would like to build the Dataframe :
data.frame( A=c(1,1,0,0,0,1,0), B=c(0,0,1,0,1,0,0), C=c(0,0,0,1,0,0,1))
Any ideas ?
--
Michel ARNAUD
Chargé de mission auprès du DRH
DGDRD-Drh - TA 174/04
Av Agropolis 34398 Montpellier cedex 5
tel : 04.67.61
Thank you
Michel
Le 09/12/2013 08:14, Berend Hasselman a écrit :
On 09-12-2013, at 08:04, Arnaud Michel wrote:
Dear R Users
I have the vector
X <- c( 6 , 4 ,12 , 3)
I would like to build a new vector by to transform it into
Y <- c(rep(X[1], X[1]), rep(X[2], X[2]), rep(X[3], X[3]), rep(X[4],
Hello,
Are you looking for Y <- rep(X, X) ?
Regards,
Pascal
On 9 December 2013 16:04, Arnaud Michel wrote:
> Dear R Users
>
> I have the vector
> X <- c( 6 , 4 ,12 , 3)
>
> I would like to build a new vector by to transform it into
> Y <- c(rep(X[1], X[1]), rep(X[2], X[2]), rep(X[3], X[3]), rep
On 09-12-2013, at 08:04, Arnaud Michel wrote:
> Dear R Users
>
> I have the vector
> X <- c( 6 , 4 ,12 , 3)
>
> I would like to build a new vector by to transform it into
> Y <- c(rep(X[1], X[1]), rep(X[2], X[2]), rep(X[3], X[3]), rep(X[4], X[4]))
>
> Have you a more elegant answer ?
Have a
Dear R Users
I have the vector
X <- c( 6 , 4 ,12 , 3)
I would like to build a new vector by to transform it into
Y <- c(rep(X[1], X[1]), rep(X[2], X[2]), rep(X[3], X[3]), rep(X[4], X[4]))
Have you a more elegant answer ?
PS : Sorry for this basic question
--
Michel ARNAUD
Chargé de mission au
8 matches
Mail list logo