R/Numeric_Only.R

Defines functions Numeric_Only

Documented in Numeric_Only

#' To clean non numeric values in a vector
#' 
#' @description Replace all non numeric values in a vector by NA's and change the vector format to be numeric
#' @param x The vector to clean
#' 
#' @export
Numeric_Only <- function(x = NULL){
  x[is.na(Is.Numeric(x))] = NA
  
  return(as.numeric(as.character(x)))
}

Try the CorReg package in your browser

Any scripts or data that you put into this service are public.

CorReg documentation built on Feb. 20, 2020, 5:07 p.m.