docs and name update

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-11-18 14:41:44 +01:00
parent 9a069a422f
commit 9d53f84427
No known key found for this signature in database
7 changed files with 39 additions and 10 deletions

View File

@ -58,7 +58,8 @@ Imports:
zip, zip,
assertthat, assertthat,
openxlsx2, openxlsx2,
readODS readODS,
forcats
Collate: Collate:
'REDCapCAST-package.R' 'REDCapCAST-package.R'
'utils.r' 'utils.r'

View File

@ -20,10 +20,14 @@ export(file_extension)
export(focused_metadata) export(focused_metadata)
export(format_subheader) export(format_subheader)
export(get_api_key) export(get_api_key)
export(guess_time_only)
export(guess_time_only_filter) export(guess_time_only_filter)
export(haven_all_levels)
export(html_tag_wrap) export(html_tag_wrap)
export(is_repeated_longitudinal) export(is_repeated_longitudinal)
export(match_fields_to_form) export(match_fields_to_form)
export(numchar2fct)
export(parse_data)
export(process_user_input) export(process_user_input)
export(read_input) export(read_input)
export(read_redcap_instrument) export(read_redcap_instrument)
@ -33,9 +37,11 @@ export(sanitize_split)
export(shiny_cast) export(shiny_cast)
export(split_non_repeating_forms) export(split_non_repeating_forms)
export(strsplitx) export(strsplitx)
export(var2fct)
importFrom(REDCapR,redcap_event_instruments) importFrom(REDCapR,redcap_event_instruments)
importFrom(REDCapR,redcap_metadata_read) importFrom(REDCapR,redcap_metadata_read)
importFrom(REDCapR,redcap_read) importFrom(REDCapR,redcap_read)
importFrom(forcats,as_factor)
importFrom(keyring,key_get) importFrom(keyring,key_get)
importFrom(keyring,key_list) importFrom(keyring,key_list)
importFrom(keyring,key_set) importFrom(keyring,key_set)

View File

@ -17,7 +17,8 @@ server <- function(input, output, session) {
dat <- shiny::reactive({ dat <- shiny::reactive({
shiny::req(input$ds) shiny::req(input$ds)
read_input(input$ds$datapath) read_input(input$ds$datapath) |>
parse_data()
}) })
# getData <- reactive({ # getData <- reactive({

View File

@ -4,7 +4,7 @@
\name{REDCapCAST-package} \name{REDCapCAST-package}
\alias{REDCapCAST} \alias{REDCapCAST}
\alias{REDCapCAST-package} \alias{REDCapCAST-package}
\title{REDCapCAST: REDCap Castellated Data Handling And Metadata Casting} \title{REDCapCAST: REDCap Castellated Data Handling and Metadata Casting}
\description{ \description{
\if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} \if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}}

View File

@ -45,7 +45,7 @@ The more advanced `ds2dd_detailed()` is a natural development. It will try to ap
The dataset should be correctly formatted for the data dictionary to preserve as much information as possible. The dataset should be correctly formatted for the data dictionary to preserve as much information as possible.
```{r eval=TRUE} ```{r eval=FALSE}
d2 <- REDCapCAST::redcapcast_data |> d2 <- REDCapCAST::redcapcast_data |>
dplyr::mutate(record_id = seq_len(dplyr::n()), dplyr::mutate(record_id = seq_len(dplyr::n()),
region=factor(region)) |> region=factor(region)) |>

View File

@ -2,7 +2,7 @@
title: "REDCapCAST" title: "REDCapCAST"
output: rmarkdown::html_vignette output: rmarkdown::html_vignette
vignette: > vignette: >
%\VignetteIndexEntry{Introduction} %\VignetteIndexEntry{REDCapCAST}
%\VignetteEngine{knitr::rmarkdown} %\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8} %\VignetteEncoding{UTF-8}
--- ---

View File

@ -14,13 +14,34 @@ knitr::opts_chunk$set(
) )
``` ```
To make the easiest possible transition from spreadsheet/dataset to REDCap, I have created a small Shiny app, which adds a graphical interface to the casting of a data dictionary and data upload. Install the package and run the app as follows: To make the easiest possible transition from spreadsheet/dataset to REDCap, I have created a small app, which adds a graphical interface to the casting of a data dictionary and data upload. Install the package and launch the app as follows:
```{r eval=FALSE} ```{r eval=FALSE}
require(REDCapCAST) REDCapCAST::shiny_cast()
shiny_cast() ```
The app primarily wraps one function: `ds2dd_detailed()`.
```{r}
REDCap_split(
records = redcapcast_data,
metadata = redcapcast_meta,
forms = "all"
) |>
sanitize_split() |>
redcap_wider() |>
ds2dd_detailed()|>
purrr::pluck("data") |>
readr::type_convert(
col_types = readr::cols(.default = readr::col_guess()))
```
```{r}
redcapcast_data |>
dplyr::mutate(dplyr::across(dplyr::everything(),as.character)) |>
readr::type_convert(
col_types = readr::cols(.default = readr::col_guess()))
``` ```
The app will launch in a new window and the interface should be fairly self-explanatory.
The app only provides the most basic functionality, but might be extended in the future.