Re: [R] decimal separator from comma to dot

2013-08-09 Thread arun
4 11.5 11.5 11.5 10 10 10 A.K. - Original Message - From: "mbres...@arpa.veneto.it" To: David Winsemius Cc: r-help@r-project.org; maxbre Sent: Friday, August 9, 2013 3:35 PM Subject: Re: [R] decimal separator from comma to dot This is my reproducible example df<-str

Re: [R] decimal separator from comma to dot

2013-08-09 Thread mbressan
uot;mbres...@arpa.veneto.it" > To: David Winsemius > Cc: r-help@r-project.org; maxbre > Sent: Friday, August 9, 2013 3:35 PM > Subject: Re: [R] decimal separator from comma to dot > > This is my reproducible example > > df<-structure(list(IDANT = c(37837L, 37838L, 3783

Re: [R] decimal separator from comma to dot

2013-08-09 Thread Rui Barradas
Hello, To change several columns you can use lapply. In what follows, idx is the vector of column numbers, corresponding to the columns you want to change: idx <- 6 # column numbers df[idx] <- lapply(df[idx], function(x) as.numeric(sub(",", ".", as.character(x # check the result str(

Re: [R] decimal separator from comma to dot

2013-08-09 Thread mbressan
This is my reproducible example df<-structure(list(IDANT = c(37837L, 37838L, 37839L, 37840L, 37841L,  37842L, 37843L, 40720L, 40721L, 40722L), N_TX = c(6L, 6L, 6L,  4L, 1L, 1L, 1L, 2L, 2L, 1L), TILT = c(0L, 0L, 0L, 0L, 6L, 6L,  6L, 0L, 0L, 0L), DIREZIONE = c(50L, 220L, 110L, 50L, 220L, 110L,  50L,

Re: [R] decimal separator from comma to dot

2013-08-09 Thread David Winsemius
On Aug 9, 2013, at 11:58 AM, maxbre wrote: > thanks david > very humbly I'm asking you and all r-help users to forgive me about > violating the rules of this great mailing list, I didn't meant to do that: I > simply slipped into that, sorry again! > > ...and what about the case of many variables

Re: [R] decimal separator from comma to dot

2013-08-09 Thread maxbre
thanks david very humbly I'm asking you and all r-help users to forgive me about violating the rules of this great mailing list, I didn't meant to do that: I simply slipped into that, sorry again! ...and what about the case of many variables to be changed at the same time? seriously, I do not wan

Re: [R] decimal separator from comma to dot

2013-08-09 Thread David Winsemius
On Aug 9, 2013, at 7:31 AM, maxbre wrote: > Thanks it's the same thread I've been looking at > But it's not answering to my questions… Please do read the Posting Guide. You are asked to include context. In this case including the citation to the Archive-stored code would have been courteous a

Re: [R] decimal separator from comma to dot

2013-08-09 Thread maxbre
Thanks it's the same thread I've been looking at But it's not answering to my questions… -- View this message in context: http://r.789695.n4.nabble.com/decimal-separator-from-comma-to-dot-tp4673414p4673433.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] decimal separator from comma to dot

2013-08-09 Thread Simon Zehnder
Hi, I think this could help you: https://stat.ethz.ch/pipermail/r-help/2008-January/152378.html Best Simon On Aug 9, 2013, at 12:19 PM, maxbre wrote: > This is my reproducible example > > df<-structure(list(IDANT = c(37837L, 37838L, 37839L, 37840L, 37841L, > 37842L, 37843L, 40720L, 40721L,

[R] decimal separator from comma to dot

2013-08-09 Thread maxbre
This is my reproducible example df<-structure(list(IDANT = c(37837L, 37838L, 37839L, 37840L, 37841L, 37842L, 37843L, 40720L, 40721L, 40722L), N_TX = c(6L, 6L, 6L, 4L, 1L, 1L, 1L, 2L, 2L, 1L), TILT = c(0L, 0L, 0L, 0L, 6L, 6L, 6L, 0L, 0L, 0L), DIREZIONE = c(50L, 220L, 110L, 50L, 220L, 110L, 50L,