new vignettes

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-02-27 12:42:58 +01:00
parent 767d03f45f
commit 409d53a6be
2 changed files with 8 additions and 8 deletions

View File

@ -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()) |>

View File

@ -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()
```