mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-19 05:07:30 +02:00
restructuring
This commit is contained in:
parent
21c2dc0444
commit
4ad21c7f57
19 changed files with 432 additions and 80 deletions
|
|
@ -26,6 +26,7 @@ function can be used to create (an) instrument(s) to add to a project in
|
|||
production.
|
||||
}
|
||||
\examples{
|
||||
\dontrun{
|
||||
data <- iris |>
|
||||
ds2dd_detailed(
|
||||
add.auto.id = TRUE,
|
||||
|
|
@ -44,7 +45,8 @@ iris |>
|
|||
setNames(glue::glue("{sample(x = c('a','b'),size = length(ncol(iris)),
|
||||
replace=TRUE,prob = rep(x=.5,2))}__{names(iris)}")) |>
|
||||
ds2dd_detailed(form.sep = "__")
|
||||
# data |>
|
||||
# purrr::pluck("meta") |>
|
||||
# create_instrument_meta(record.id = FALSE)
|
||||
data |>
|
||||
purrr::pluck("meta") |>
|
||||
create_instrument_meta(record.id = FALSE)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/ds2dd.R
|
||||
% Please edit documentation in R/ds2dd_detailed.R
|
||||
\name{ds2dd}
|
||||
\alias{ds2dd}
|
||||
\title{(DEPRECATED) Data set to data dictionary function}
|
||||
|
|
@ -11,7 +11,7 @@ ds2dd(
|
|||
field.type = "text",
|
||||
field.label = NULL,
|
||||
include.column.names = FALSE,
|
||||
metadata = metadata_names
|
||||
metadata = REDCapCAST::redcap_meta_default()
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
|
|
@ -34,7 +34,7 @@ names.}
|
|||
column names for original data set for upload.}
|
||||
|
||||
\item{metadata}{Metadata column names. Default is the included
|
||||
REDCapCAST::metadata_names.}
|
||||
REDCapCAST::redcap_meta_default.}
|
||||
}
|
||||
\value{
|
||||
data.frame or list of data.frame and vector
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ ds2dd_detailed(
|
|||
field.label = NULL,
|
||||
field.label.attr = "label",
|
||||
field.validation = NULL,
|
||||
metadata = names(REDCapCAST::redcapcast_meta),
|
||||
metadata = REDCapCAST::redcap_meta_default(),
|
||||
convert.logicals = TRUE
|
||||
)
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ or attribute `factor.labels.attr` for haven_labelled data set (imported .dta
|
|||
file with `haven::read_dta()`).}
|
||||
|
||||
\item{metadata}{redcap metadata headings. Default is
|
||||
REDCapCAST:::metadata_names.}
|
||||
REDCapCAST::redcap_meta_default().}
|
||||
|
||||
\item{convert.logicals}{convert logicals to factor. Default is TRUE.}
|
||||
}
|
||||
|
|
@ -76,7 +76,8 @@ Ensure, that the data set is formatted with as much information as possible.
|
|||
}
|
||||
\examples{
|
||||
## Basic parsing with default options
|
||||
REDCapCAST::redcapcast_data |>
|
||||
requireNamespace("REDCapCAST")
|
||||
redcapcast_data |>
|
||||
dplyr::select(-dplyr::starts_with("redcap_")) |>
|
||||
ds2dd_detailed()
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ function can be used to create (an) instrument(s) to add to a project in
|
|||
production.
|
||||
}
|
||||
\examples{
|
||||
#iris |>
|
||||
# iris |>
|
||||
# ds2dd_detailed(
|
||||
# add.auto.id = TRUE,
|
||||
# form.name = sample(c("b", "c"), size = 6, replace = TRUE, prob = rep(.5, 2))
|
||||
|
|
@ -40,7 +40,7 @@ production.
|
|||
# export_redcap_instrument(.x,file=here::here(paste0(.i,Sys.Date(),".zip")))
|
||||
# })
|
||||
|
||||
#iris |>
|
||||
# iris |>
|
||||
# ds2dd_detailed(
|
||||
# add.auto.id = TRUE
|
||||
# ) |>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ structure(c(1, 2, 3, 2, 10, 9),
|
|||
# as_factor() |>
|
||||
# fct2num()
|
||||
|
||||
v <- sample(6:19,20,TRUE) |> factor()
|
||||
v <- sample(6:19, 20, TRUE) |> factor()
|
||||
dput(v)
|
||||
named_levels(v)
|
||||
fct2num(v)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ logical
|
|||
Test if vector can be interpreted as roman numerals
|
||||
}
|
||||
\examples{
|
||||
sample(1:100,10) |> as.roman() |> possibly_roman()
|
||||
sample(c(TRUE,FALSE),10,TRUE)|> possibly_roman()
|
||||
rep(NA,10)|> possibly_roman()
|
||||
sample(1:100, 10) |>
|
||||
as.roman() |>
|
||||
possibly_roman()
|
||||
sample(c(TRUE, FALSE), 10, TRUE) |> possibly_roman()
|
||||
rep(NA, 10) |> possibly_roman()
|
||||
}
|
||||
|
|
|
|||
20
man/redcap_meta_default.Rd
Normal file
20
man/redcap_meta_default.Rd
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/ds2dd_detailed.R
|
||||
\name{redcap_meta_default}
|
||||
\alias{redcap_meta_default}
|
||||
\title{Default column names of a REDCap data dictionary}
|
||||
\usage{
|
||||
redcap_meta_default(...)
|
||||
}
|
||||
\arguments{
|
||||
\item{...}{ignored for now}
|
||||
}
|
||||
\value{
|
||||
character vector
|
||||
}
|
||||
\description{
|
||||
Default column names of a REDCap data dictionary
|
||||
}
|
||||
\examples{
|
||||
dput(redcap_meta_default())
|
||||
}
|
||||
|
|
@ -31,6 +31,6 @@ A data frame with 22 variables:
|
|||
data(redcapcast_meta)
|
||||
}
|
||||
\description{
|
||||
This metadata dataset from a REDCap database is for demonstrational purposes.
|
||||
This metadata dataset from a REDCap database is for demonstration purposes.
|
||||
}
|
||||
\keyword{datasets}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue