Re: [R] sub function problem

2014-03-04 Thread Philippe Grosjean
al Message- >> From: Massimiliano Tripoli [mailto:mtrip...@istat.it] >> Sent: Monday, March 03, 2014 5:39 PM >> To: PIKAL Petr >> Cc: r-help@r-project.org >> Subject: Re: [R] sub function problem >> >> Hi Petr, >> thanks for your response. >> You

Re: [R] sub function problem

2014-03-03 Thread PIKAL Petr
OS, R version, Tinn-R version and code which leads to such error. Regards Petr > -Original Message- > From: Massimiliano Tripoli [mailto:mtrip...@istat.it] > Sent: Monday, March 03, 2014 5:39 PM > To: PIKAL Petr > Cc: r-help@r-project.org > Subject: Re: [R] sub funct

Re: [R] sub function problem

2014-03-03 Thread Massimiliano Tripoli
;PIKAL Petr" A: "Massimiliano Tripoli" , r-help@r-project.org Inviato: Lunedì, 3 marzo 2014 10:36:02 Oggetto: RE: [R] sub function problem Hi Everything works for me as expected. Nothing happens R starts as usual. You can shorten your function corregge2 <- function(stringa){ nc <

Re: [R] sub function problem

2014-03-03 Thread PIKAL Petr
oun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Massimiliano Tripoli > Sent: Friday, February 28, 2014 5:44 PM > To: r-help@r-project.org > Subject: [R] sub function problem > > > Dear all, > > I write a R function that it should handles string

[R] sub function problem

2014-02-28 Thread Massimiliano Tripoli
Dear all, I write a R function that it should handles strings like removing spaces at the beginning or returning NA according an IF condition. Here you are the code: corregge.CF <- function(stringa){ nc <- nchar(stringa) stringa <- sub("^ ", "", stringa) stringa <- sub(" +$", "", stri