#' @title Remove rows that exceed a specified percentage of missing values
#' @description Remove rows that exceed a specified percentage of missing values. The default is set to remove anything above 85%.
#' @param df The name of the dataframe, not in quotes, for which the columns need to be converted to character class.
#' @param pct The minimum percentage of missing data that will cause a row to be deleted.
#' @return Dataframe
#' @export
removeNARows <- function(df, pct = .85){
df <- df[rowSums(is.na(df))/ncol(df) < pct,]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.