diff --git a/DESCRIPTION b/DESCRIPTION index fb93368..8e1af46 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -31,8 +31,7 @@ Imports: Suggests: rmarkdown, testthat (>= 3.0.0), - ifadv, pkgdown, - ggrepel -Remotes: git::https://github.com/elpaco-escience/ifadv.git + ggrepel, + utils Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index a890499..9dae829 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,6 +6,7 @@ export(add_lines) export(calculate_timing) export(geom_token) export(geom_turn) +export(get_ifadv) export(init) export(plot_density) export(plot_quality) diff --git a/R/auxs.R b/R/auxs.R new file mode 100644 index 0000000..5f40d0e --- /dev/null +++ b/R/auxs.R @@ -0,0 +1,16 @@ +#' Get IFADV data +#' +#' IFA Dialog Video corpus data +#' Available in the public repository: +#' https://github.com/elpaco-escience/ifadv +#' +#' This function requires an internet connection. +#' +#' @param source (default = "https://raw.githubusercontent.com/elpaco-escience/ifadv/csv/data/ifadv.csv") +#' +#' @return A data frame containing the IFADV dataset +#' @export +#' +get_ifadv <- function(source="https://raw.githubusercontent.com/elpaco-escience/ifadv/csv/data/ifadv.csv") { + return(utils::read.csv(source)) +} diff --git a/man/get_ifadv.Rd b/man/get_ifadv.Rd new file mode 100644 index 0000000..7214e4b --- /dev/null +++ b/man/get_ifadv.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/auxs.R +\name{get_ifadv} +\alias{get_ifadv} +\title{Get IFADV data} +\usage{ +get_ifadv( + source = "https://raw.githubusercontent.com/elpaco-escience/ifadv/csv/data/ifadv.csv" +) +} +\arguments{ +\item{source}{(default = "https://raw.githubusercontent.com/elpaco-escience/ifadv/csv/data/ifadv.csv")} +} +\value{ +A data frame containing the IFADV dataset +} +\description{ +IFA Dialog Video corpus data +Available in the public repository: +https://github.com/elpaco-escience/ifadv +} +\details{ +This function requires an internet connection +} diff --git a/tests/testthat/_snaps/report.md b/tests/testthat/_snaps/report.md index eb6ceaa..0fa9e09 100644 --- a/tests/testthat/_snaps/report.md +++ b/tests/testthat/_snaps/report.md @@ -1,7 +1,7 @@ # summary reports are accurate Code - report_stats(data) + report_stats(testdata) Output ### Corpus-level statistics diff --git a/tests/testthat/test-plots.R b/tests/testthat/test-plots.R index dd816f2..f918ac6 100644 --- a/tests/testthat/test-plots.R +++ b/tests/testthat/test-plots.R @@ -12,7 +12,7 @@ # between new and reference image. They are clickable from the test menu. # Load the test data -testdata <- ifadv::ifadv +testdata <- get_ifadv() #' Auxiliary decorator #' diff --git a/tests/testthat/test-report.R b/tests/testthat/test-report.R index b5ca7a7..e1e2dc0 100644 --- a/tests/testthat/test-report.R +++ b/tests/testthat/test-report.R @@ -1,10 +1,10 @@ -## set up the test environment -data <- ifadv::ifadv +## Load the test data +testdata <- get_ifadv() test_that("summary reports are accurate", { expect_snapshot( report_stats( - data + testdata ) ) }) diff --git a/vignettes/workflows.Rmd b/vignettes/workflows.Rmd index 73bb2dc..5d5ccf6 100644 --- a/vignettes/workflows.Rmd +++ b/vignettes/workflows.Rmd @@ -33,8 +33,8 @@ The snippet below initializes the talkr dataset using the ifadv data. For more i ```{r} -data <- init(ifadv::ifadv) - +data <- get_ifadv() +data <- init(data) ``` Essential to any `talkr` workflow is a minimal set of data fields. These are the following: