suppressWarnings(a <- as.numeric(c(1, 2, pi, "a", 9, "z")))

b

On Jan 31, 2007, at 2:35 PM, Konrad wrote:

> Hello,
> Is there a way to convert a character to a number with out getting  
> a warning?  I have a vector that has both numbers and letters in it  
> and I need to convert it to only numbers.  At the moment I'm using  
> as.numeric but it is generating a warning when it converts a  
> letter.  Is there another function out there that will do what I  
> need or is there a way to turn off the warnings as I don't want the  
> warning to be displayed to the end user?
>
> Konrad Hammel
> Engineer
> Prilink LTD
> [EMAIL PROTECTED]
> 905.305.1096
>
>       [[alternative HTML version deleted]]
>
> ______________________________________________
> [email protected] 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.

______________________________________________
[email protected] 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.

Reply via email to