diff --git a/R/helpers.R b/R/helpers.R index f537d80..1cf91db 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -164,3 +164,21 @@ file_export <- function(data, output.format = c("df", "teal", "list"), filename, out } + + +#' Default data parsing +#' +#' @param data +#' +#' @returns data.frame or tibble +#' @export +#' +#' @examples +#' mtcars |> str() +#' mtcars |> default_parsing() |> str() +default_parsing <- function(data){ + data |> + REDCapCAST::parse_data() |> + REDCapCAST::as_factor() |> + REDCapCAST::numchar2fct() +} diff --git a/man/default_parsing.Rd b/man/default_parsing.Rd new file mode 100644 index 0000000..b1ad21d --- /dev/null +++ b/man/default_parsing.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/helpers.R +\name{default_parsing} +\alias{default_parsing} +\title{Default data parsing} +\usage{ +default_parsing(data) +} +\arguments{ +\item{data}{} +} +\value{ +data.frame or tibble +} +\description{ +Default data parsing +} +\examples{ +mtcars |> str() +mtcars |> default_parsing() |> str() +}