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
- Host: GitHub
- URL: https://github.com/mosesotieno/datalabels
- Owner: mosesotieno
- License: other
- Created: 2021-10-26T13:06:35.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-26T13:44:40.000Z (over 3 years ago)
- Last Synced: 2024-08-13T07:11:31.189Z (8 months ago)
- Language: R
- Size: 27.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - mosesotieno/datalabels - Labels a Dataset from Data Dictionary (R)
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")
```
## ExampleTo create factors and label the variables proceed as follows:
```{r example}
library(datalabels)
## Load the sample datamydata <- 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
```