make.numeric: Convert a numeric vector if all data in vector is numeric

Description Usage Arguments Value See Also Examples

View source: R/write32.dta.R

Description

Checks if all data can be converted to numeric and forces any "" to be NA

Usage

1

Arguments

x

vector of data

Value

numeric vector or vector of class passed in

See Also

write32.dta, as.numeric

Examples

1
2
3
4
5
6
7
8
x <- c("1", "2", "50.5")
make.numeric(x)
x[4] <- NA
make.numeric(x)
x[4] <- ""
make.numeric(x)
fac = factor(x)
make.numeric(x)

muschellij2/processVISION documentation built on May 23, 2019, 9:54 a.m.