knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of datavyur is to provide set of functions to handle import/export between R and the qualitative coding software Datavyu.
You can install the released version of datavyur from CRAN with:
install.packages("datavyur")
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("iamamutt/datavyur")
This is a basic example which shows you how to import Datavyu data into R. First, load the package.
# Load the datavyur library to use the functions below library(datavyur)
Next, point to a directory containing .csv
data that has been previously exported using the script datavyu2csv.rb
(see the section "Exporting Datavyu .opf
files" below). This example uses the internal package data directory for demonstration purposes.
ex_data_dir <- datavyur_internal_data()
dv_info <- datavyu_search(folder=ex_data_dir)
The folder ex_data_dir
originally contained r length(unique(dv_info$file))
.opf
files that have been split into r length(unique(dv_info$local))
separate .csv
files, one .csv
file for each Datavyu file (.opf
) and column combination.
Names of .csv
files after using the Ruby script datavyu2csv.rb
:
list.files(ex_data_dir, pattern="\\.csv$")
Names of the original Datavyu .opf
files:
unique(dv_info$file)
Names of the Datavyu columns found inside the set of exported .csv
files:
unique(dv_info$column)
This information can be obtained by using the function datavyu_search
.
datavyu_search(folder=ex_data_dir)
Use the import_datavyu
function to import Datavyu columns into R as separate data.frames
.
Since there are multiple Datavyu columns that need to be imported from ex_data_dir
, set as_list=TRUE
to import a data.frame
for each Datavyu column.
dv_columns <- import_datavyu(folder=ex_data_dir, as_list=TRUE)
You can access each data.frame
like so:
child_data <- dv_columns$childhands
The first few rows are shown below.
knitr::kable(head(child_data))
To learn more, see the Getting Started vignette.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.