added a helper function for default parsing

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-12-19 11:33:19 +01:00
parent f18a181faf
commit 9ca7698200
No known key found for this signature in database
2 changed files with 39 additions and 0 deletions

View file

@ -164,3 +164,21 @@ file_export <- function(data, output.format = c("df", "teal", "list"), filename,
out 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()
}

21
man/default_parsing.Rd Normal file
View file

@ -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()
}