R/remove_threshold.R

Defines functions remove_threshold

Documented in remove_threshold

#' function replaces every value below a threshold with NA
#'
#' @param file   object containing data (data frame, matrix, array)
#' @param column  column in object containing data to apply the function on
#' @param threshold every value <= threshold gets replaced with NA
#' @return file with replaced values
#' @export


remove_threshold <- function(file, column, threshold){

  outlier <- which(file[column] <= threshold ) ## <- values to replace

  file[outlier,column] <- NA

  return(file)
}
plvoit/PaulsPack documentation built on Dec. 15, 2019, 10:24 p.m.