An open API service indexing awesome lists of open source software.

https://github.com/mosesotieno/datalabels

Labels a Dataset from Data Dictionary
https://github.com/mosesotieno/datalabels

Last synced: 4 months ago
JSON representation

Labels a Dataset from Data Dictionary

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# datalabels

Creating factors for five or ten variables is not so much demanding. Neither is labelling four variables an uphill task. The problem begins when you have well written data dictionary with 1000+ variables and you wish to use it to create the variable labels and create factors from it. This is where this package comes in handy. Assumption is made that you have a data dictionary that you wish to map to a dataset.

## Installation

You can install this package as so:

``` r
# install.packages("devtools")
devtools::install_github("mosesotieno/datalabels")
```
## Example

To create factors and label the variables proceed as follows:

```{r example}
library(datalabels)
## Load the sample data

mydata <- datalabels::sample_data
mydata

## Load the data dictionary
mydictionary <- datalabels::clean_dictionary
mydictionary[, 1:3]

## Create the factors

mydata <- create_factors(mydata, mydictionary)
str(mydata)

## Label the variables
mydata <- create_labels(mydata, mydictionary)
str(mydata)

## The dataset has been properly labelled

```