From 409d53a6bea0b63ca67e8e756463b4f8c185422c Mon Sep 17 00:00:00 2001 From: Andreas Gammelgaard Damsbo Date: Tue, 27 Feb 2024 12:42:58 +0100 Subject: [PATCH] new vignettes --- .../{Database creation.Rmd => Database-creation.Rmd} | 10 +++++----- vignettes/{Shiny casting.Rmd => Shiny-app.Rmd} | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) rename vignettes/{Database creation.Rmd => Database-creation.Rmd} (95%) rename vignettes/{Shiny casting.Rmd => Shiny-app.Rmd} (90%) diff --git a/vignettes/Database creation.Rmd b/vignettes/Database-creation.Rmd similarity index 95% rename from vignettes/Database creation.Rmd rename to vignettes/Database-creation.Rmd index 088fa8b..c226385 100644 --- a/vignettes/Database creation.Rmd +++ b/vignettes/Database-creation.Rmd @@ -1,8 +1,8 @@ --- -title: "Database casting" +title: "Database-creation" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Database casting} + %\VignetteIndexEntry{Database-creation} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- @@ -22,17 +22,17 @@ library(REDCapCAST) THe first iteration of a dataset to data dictionary function is the `ds2dd()`, which creates a very basic data dictionary with all variables stored as text. This is sufficient for just storing old datasets/spreadsheets securely in REDCap. -```{r} +```{r eval=FALSE} mtcars |> dplyr::mutate(record_id = seq_len(dplyr::n())) |> - ds2dd() + ds2dd() |> str() ``` The more advanced `ds2dd_detailed()` is a natural development. It will try to apply the most common data classes for data validation and will assume that the first column is the id number. It outputs a list with the dataset with modified variable names to comply with REDCap naming conventions and a data dictionary. The dataset should be correctly formatted for the data dictionary to preserve as much information as possible. -```{r} +```{r eval=FALSE} dd_ls <- mtcars |> dplyr::mutate(record_id = seq_len(dplyr::n())) |> dplyr::select(record_id, dplyr::everything()) |> diff --git a/vignettes/Shiny casting.Rmd b/vignettes/Shiny-app.Rmd similarity index 90% rename from vignettes/Shiny casting.Rmd rename to vignettes/Shiny-app.Rmd index c2c1629..f379153 100644 --- a/vignettes/Shiny casting.Rmd +++ b/vignettes/Shiny-app.Rmd @@ -1,8 +1,8 @@ --- -title: "Introduction" +title: "Shiny-app" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Introduction} + %\VignetteIndexEntry{Shiny-app} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- @@ -20,7 +20,7 @@ library(REDCapCAST) To make the easiest possible transistion 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: -```{r} +```{r eval=FALSE} require(REDCapCAST) shiny_cast() ```