R/unfactor.R

Defines functions unfactor

Documented in unfactor

#' Convert all factors in a data.frame to strings
#'
#' @param df the data frame to operate on
#'
#' @return modified data.frame with factor columns converted to character-type
#' @export
unfactor <- function(df) {
	id <- sapply(df, is.factor)
	df[id] <- lapply(df[id], as.character)
	df
}
stackcon/rngt documentation built on June 17, 2022, 5:29 p.m.