On Thu, Mar 12, 2015 at 9:52 PM, John McKown <john.archie.mck...@gmail.com> wrote: > [...] > One problem is that Adrian wanted, for some reason, to exclude numbers > such as "2." but accept "2.0" . That is, no unnecessary trailing > decimal point. as.numeric() will not fail on "2." since that is a > number. The example grep() specifically excludes this by requiring at > least one digit after any decimal point.
Indeed, but that was completely unintentional since I knew ".2" should be a number and I somehow thought "2." was not supposed to be a number. I learned a lot about regular expressions (thanks again John), and both solutions work (thanks very much Steve as well). Best, Adrian -- Adrian Dusa University of Bucharest Romanian Social Data Archive Soseaua Panduri nr.90 050663 Bucharest sector 5 Romania ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.