Re: [R] To transform a vector of qualitatives values into a dataframe of quantitatives values

2013-12-11 Thread Andrea Spano
more generally x <- c("A", "A", "B", "C", "B", "A", "C") as.data.frame(Map(match , table = unique(x), nomatch = 0, x = list(x))) Andrea On 11 December 2013 14:43, Duncan Murdoch wrote: > On 13-12-11 8:22 AM, PIKAL Petr wrote: > >> Hi >> >> -Original Message- >>> From: r-help-boun...@r

Re: [R] To transform a vector of qualitatives values into a dataframe of quantitatives values

2013-12-11 Thread Duncan Murdoch
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 datafr

Re: [R] To transform a vector of qualitatives values into a dataframe of quantitatives values

2013-12-11 Thread PIKAL Petr
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 quantitatives values

Re: [R] To transform a vector

2013-12-08 Thread Arnaud Michel
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],

Re: [R] To transform a vector

2013-12-08 Thread Pascal Oettli
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

Re: [R] To transform a vector

2013-12-08 Thread Berend Hasselman
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