#' Find Cols Function
#'
#' Given a dataframe and a number x, prints the first x non-na values of each column (though prints first 5 values if no number "x" is specified).
#' @param df A DataFrame
#' @param x Number of non-na items to print for each column.
#' @keywords dataframe
#' @export
#' @examples
#' print_initial_vals(iris)
find_cols <- function(df, x) {
# Remove crap accountnumber columns
cols_to_find <- c()
for (i in 1:ncol(df)) {
for (j in 1:length(x)) {
if (grepl(x[j], names(df)[i])) {
cols_to_find <- c(cols_to_find, i)
}
}
}
return(names(df)[cols_to_find])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.