Thanks for the tip!
Andrew
On Fri, Apr 9, 2010 at 8:04 PM, Gabor Grothendieck
wrote:
> Try this:
>
> suppressWarnings(as.numeric("A"))
>
> On Fri, Apr 9, 2010 at 7:22 PM, Andrew Yee wrote:
> > I'm interested in testing whether or not a character string is numeric or
> > not as follows:
> >
> >
Scratch my previous suggestion. Utter nonsense.
Sigh... It's been a tough week.
-- Bert
Bert Gunter
Genentech Nonclinical Biostatistics
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Andrew Yee
Sent: Friday, April 09, 2010
Try this:
suppressWarnings(as.numeric("A"))
On Fri, Apr 9, 2010 at 7:22 PM, Andrew Yee wrote:
> I'm interested in testing whether or not a character string is numeric or
> not as follows:
>
> is.na(as.numeric('3')) # returns F
> is.na(as.numeric('A')) # I'd like this to return T without issuing
I suspect the following is way slower and clunkier, but it does give you
another way:
?tryCatch ## as in
> tryCatch(1+x,error=function(e) return("darnit"))
[1] "darnit"
Cheers,
Bert
Bert Gunter
Genentech Nonclinical Biostatistics
-Original Message-
From: r-help-boun...@r-project.o
4 matches
Mail list logo