ez.blank2na | R Documentation |
Replaces blank-ish elements of a factor or character vector to NA
ez.blank2na(x, na.strings = c("", ".", "NA", "na", "N/A", "n/a", "NaN", "nan"))
x |
a vector of factor or character or any type |
na.strings |
case sensitive strings that will be coverted to NA. The function will do a trimws(x,'both') before conversion. If NULL, do only trimws, no conversion to NA. |
Returns a vector trimws (always for factor, character) and NA converted (if matching na.strings). Attributes will also be kept ('label','labels', 'value.labels').
ez.nan2na
, ez.is.numeric.like
, ez.num
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.