Thank you I knew that somebody can use power of gsub better than myself.
Petr > -----Original Message----- > From: Noia Raindrops [mailto:noia.raindr...@gmail.com] > Sent: Tuesday, August 21, 2012 12:33 PM > To: PIKAL Petr > Cc: r-help > Subject: Re: [R] reexpr transform nonumeric values to numeric > > Use backreference: > > as.numeric(gsub("^(.*)-$", "-\\1", as.character(temp))) > > -- > Noia Raindrops > noia.raindr...@gmail.com > > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.