1\name{all.is.numeric} 2\alias{all.is.numeric} 3\title{Check if All Elements in Character Vector are Numeric} 4\description{ 5Tests, without issuing warnings, whether all elements of a character 6vector are legal numeric values, or optionally converts the vector to a 7numeric vector. Leading and trailing blanks in \code{x} are ignored. 8} 9\usage{ 10all.is.numeric(x, what = c("test", "vector"), extras=c('.','NA')) 11} 12\arguments{ 13 \item{x}{a character vector} 14 \item{what}{specify \code{what="vector"} to return a numeric vector if 15 it passes the test, or the original character vector otherwise} 16 \item{extras}{a vector of character strings to count as numeric 17 values, other than \code{""}.} 18} 19\value{a logical value if \code{what="test"} or a vector otherwise} 20\author{Frank Harrell} 21\seealso{\code{\link{as.numeric}}} 22\examples{ 23all.is.numeric(c('1','1.2','3')) 24all.is.numeric(c('1','1.2','3a')) 25all.is.numeric(c('1','1.2','3'),'vector') 26all.is.numeric(c('1','1.2','3a'),'vector') 27all.is.numeric(c('1','',' .'),'vector') 28} 29\keyword{character} 30