mirror of
https://github.com/agdamsbo/stRoke.git
synced 2024-11-21 20:40:22 +01:00
ds2dd bug fixed and new param to specify metadata
This commit is contained in:
parent
55679c7845
commit
fed6711990
@ -1,6 +1,6 @@
|
||||
Package: stRoke
|
||||
Title: Clinical Stroke Research
|
||||
Version: 23.6.2
|
||||
Version: 23.6.3
|
||||
Authors@R:
|
||||
person("Andreas Gammelgaard", "Damsbo", , "agdamsbo@clin.au.dk", role = c("aut", "cre"),
|
||||
comment = c(ORCID = "0000-0002-7559-1154"))
|
||||
|
6
NEWS.md
6
NEWS.md
@ -1,3 +1,9 @@
|
||||
# stRoke 23.6.3
|
||||
|
||||
### Bug
|
||||
|
||||
* Fixed `ds2dd()` bug after first practical implementation.
|
||||
|
||||
# stRoke 23.6.2
|
||||
|
||||
### Functions:
|
||||
|
@ -13,6 +13,8 @@ utils::globalVariables(c("metadata_names"))
|
||||
#' names.
|
||||
#' @param include.column.names Flag to give detailed output including new
|
||||
#' column names for original data set for upload.
|
||||
#' @param metadata Metadata dataframe. Default is the included
|
||||
#' stRoke::metadata_names.
|
||||
#'
|
||||
#' @return data.frame or list of data.frame and vector
|
||||
#' @export
|
||||
@ -27,9 +29,10 @@ ds2dd <-
|
||||
form.name = "basis",
|
||||
field.type = "text",
|
||||
field.label = NULL,
|
||||
include.column.names = FALSE) {
|
||||
dd <- data.frame(matrix(ncol = length(metadata_names), nrow = ncol(ds)))
|
||||
colnames(dd) <- metadata_names
|
||||
include.column.names = FALSE,
|
||||
metadata = stRoke::metadata_names) {
|
||||
dd <- data.frame(matrix(ncol = length(metadata), nrow = ncol(ds)))
|
||||
colnames(dd) <- metadata
|
||||
|
||||
if (is.character(record.id) & !record.id %in% colnames(ds)) {
|
||||
stop("Provided record.id is not a variable name in provided data set.")
|
||||
|
@ -10,7 +10,8 @@ ds2dd(
|
||||
form.name = "basis",
|
||||
field.type = "text",
|
||||
field.label = NULL,
|
||||
include.column.names = FALSE
|
||||
include.column.names = FALSE,
|
||||
metadata = stRoke::metadata_names
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
@ -31,6 +32,9 @@ names.}
|
||||
|
||||
\item{include.column.names}{Flag to give detailed output including new
|
||||
column names for original data set for upload.}
|
||||
|
||||
\item{metadata}{Metadata dataframe. Default is the included
|
||||
stRoke::metadata_names.}
|
||||
}
|
||||
\value{
|
||||
data.frame or list of data.frame and vector
|
||||
|
Loading…
Reference in New Issue
Block a user