ready for cran

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-03-05 13:41:08 +01:00
commit 10064d7ee0
No known key found for this signature in database
7 changed files with 29 additions and 9 deletions

View file

@ -52,4 +52,7 @@ ds |>
as_logical() |>
sapply(class)
ds$A |> class()
sample(c("TRUE",NA), 20, TRUE) |>
as_logical()
as_logical(0)
}

View file

@ -49,5 +49,5 @@ Migrated from stRoke ds2dd(). Fits better with the functionality of
}
\examples{
redcapcast_data$record_id <- seq_len(nrow(redcapcast_data))
ds2dd(redcapcast_data, include.column.names=TRUE)
ds2dd(redcapcast_data, include.column.names = TRUE)
}

View file

@ -16,7 +16,7 @@ ds2dd_detailed(
field.label.attr = "label",
field.validation = NULL,
metadata = names(REDCapCAST::redcapcast_meta),
convert.logicals = TRUE
convert.logicals = FALSE
)
}
\arguments{
@ -91,7 +91,10 @@ iris |>
form.name = sample(c("b", "c"), size = 6, replace = TRUE, prob = rep(.5, 2))
) |>
purrr::pluck("meta")
mtcars |> numchar2fct() |> ds2dd_detailed(add.auto.id = TRUE)
mtcars |>
dplyr::mutate(unknown = NA) |>
numchar2fct() |>
ds2dd_detailed(add.auto.id = TRUE)
## Using column name suffix to carry form name
data <- iris |>

View file

@ -4,20 +4,30 @@
\alias{easy_redcap}
\title{Secure API key storage and data acquisition in one}
\usage{
easy_redcap(project.name, widen.data = TRUE, uri, raw_or_label = "both", ...)
easy_redcap(
project.name,
uri,
raw_or_label = "both",
data_format = c("wide", "list", "redcap", "long"),
widen.data = NULL,
...
)
}
\arguments{
\item{project.name}{The name of the current project (for key storage with
\link[keyring]{key_set}, using the default keyring)}
\item{widen.data}{argument to widen the exported data}
\item{uri}{REDCap database API uri}
\item{raw_or_label}{argument passed on to
\link[REDCapCAST]{read_redcap_tables}. Default is "both" to get labelled
data.}
\item{data_format}{Choose the data}
\item{widen.data}{argument to widen the exported data. [DEPRECATED], use
`data_format`instead}
\item{...}{arguments passed on to \link[REDCapCAST]{read_redcap_tables}.}
}
\value{

View file

@ -19,5 +19,5 @@ Applying \link[REDCapCAST]{as_factor} to the data.frame or variable, will
coerce to a factor.
}
\examples{
format_redcap_factor(sample(1:3,20,TRUE),"1, First. | 2, second | 3, THIRD")
format_redcap_factor(sample(1:3, 20, TRUE), "1, First. | 2, second | 3, THIRD")
}

View file

@ -12,7 +12,7 @@ read_redcap_tables(
events = NULL,
forms = NULL,
raw_or_label = c("raw", "label", "both"),
split_forms = "all",
split_forms = c("all", "repeating", "none"),
...
)
}
@ -40,7 +40,7 @@ read_redcap_tables(
\link[REDCapCAST]{fct_drop} to drop empty levels.}
\item{split_forms}{Whether to split "repeating" or "all" forms, default is
all.}
all. Give "none" to export native semi-long REDCap format}
\item{...}{passed on to \link[REDCapR]{redcap_read}}
}