Description Details Note Author(s) See Also Examples
vartors is an R package that produces R script using definition of variables described by user. It could help to import, adapt to R classes and perform descriptive analysis on each variable according to its type.
This page explain the main concepts in vartors
. See also the vignettes. There is one with a tutorial :
vignette(topic = "usage", package = "vartors")
and one with the complete workflow
vignette(topic = "workflow", package = "vartors")
The package vartors was created to speed-up the error-prone and important cleaning data phase in context of the statistical consultations. These methodology consultations are an important part of our daily work. The idea is to help physicians of our hospital to process their data and make accurate analysis. In our workflow, the physician must come with a database (mainly an Excel or .csv file), a description of the variables and a good question. For the moment, we spend too much time to clean up data and not enough to analyze it. That's where vartors may help.
We will describe here in a compact way the workflow. For more details, see the documentation of each function and the vignettes.
The global workflow is :
Create a definition of variables table. The descvars_skeleton
function could help you to initiate this. Fill all the characteristics of each variable, especially the type.
Import this definition of variables table in R if it was created in a spreadsheet program, for example with read.csv
, read.table
or read.xlsx
, to have it in data.frame
.
Use create_script
to create a script according to the definition of each variable.
Write this script in a file with write_file
Adapt your new script to special cases, test it line by line, and produce a report, for example with knitr
It's possible to use various built-ins script templates in .R
or .Rmd
with the function import_template
. The user could also create his own script templates by exporting a built-in one with export_template
. It's a flexible way to allow each user to adapt and perform analysis on each variable as he want.
For bugreports, features request, use the github issue tracking at https://github.com/jomuller/vartors/issues.
Special thanks to :
The GMRC (Groupe M<c3><a9>thode en Recherche Clinique) team of Service de Sant<c3><a9> Public, H<c3><b4>pitaux Universitaires de Strasbourg :
Dr Erik-Andr<c3><a9> Sauleau to supervise me during this work
Mickael Schaeffer for all these advices, bugtracking and coding-mate in another package
Pr Nicolas Meyer to accept me to work on this package and all his advices
Dr Fran<c3><a7>ois Lef<c3><a8>bvre, Dr Fran<c3><a7>ois S<c3><a9>verac, Ma<c3><ab>l Barthoulot, Pierre Collard Dutilleul for advices and bugtracking.
Pr Bruno Falissard Master 2 courses and his contagious enthusiasm about R
My classmates in the Master 2 M<c3><a9>thodologie et Statistiques en Recherche Biom<c3><a9>dicale for nice debates and ideas.
Christophe Genollini for his free manuals: Petit Manuel de S4, Construire un Package and R, Bonnes pratiques
Hadley Wickham for his on-line book Advanced R and his helpful packages roxygen2, devtools, testthat and ggplot2 used in this package.
The R Core Team and particularly Uwe Ligges for his reviews and his tips.
The peoples implicated in the free softwares and websites used to create this package : R, RStudio, Git, GitHub, StackOverflow.
Joris Muller
The mains methods are create_script
, import_template
and import_vardef
. The main work to the user is to fill a definition of variables table.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Import a data.frame containing the description of the variables
# Show the description of the variable
sample_descvar
# Create the script skeleton simply with create_script()
script_skeleton <- create_script(sample_descvar)
# watch the result
script_skeleton
# Could be written in a file with the write() method
## Not run:
write_file(script_skeleton)
## End(Not run)
# It's possible to create a simple script for a single variable
a_variable_definition <- vardef(varlabel = "Creatinine Clearance", rname ="creat", type="numeric" )
create_script(a_variable_definition)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.