R/na_replace_in_df.R

Defines functions na_replace_in_df

Documented in na_replace_in_df

#' @title na to x in df with all columns
#' @description na to x in df with all columns
#' @param df dataframe
#' @param x the replace value
#'
#' @return dataframe
#'
#' @examples
#'
#' @rdname na_replace_in_df
#' @export

na_replace_in_df <- function(df, x){
    df <-
    df %>%
        dplyr::mutate_all(~ tidyr::replace_na(., x))
    return(df)
}
jixing475/manuscriptsJX documentation built on April 20, 2020, 9:55 a.m.