Skip to content

Commit

Permalink
117 ensure fresh install works even if ifadv missing (#121)
Browse files Browse the repository at this point in the history
* Remove ifadv from dependencies

It is not an official CRAN dependency

* Hot fix the problem with ifadv

* Hot fix the problem with ifadv without using devtools

* Improvements in get_ifadv

But still causing odd problems: tests go fine on testing, but fail on checking

* Greatly simplify the download process

For some reason, native R data files (.rda) are less comfortable for R than the good-old csv. I pushed a csv copy of the rda file to https://github.com/elpaco-escience/ifadv/tree/csv, and that's the one we are using now.
  • Loading branch information
PabRod authored Aug 31, 2024
1 parent 7f67d97 commit 5aef8bf
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 10 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions R/auxs.R
Original file line number Diff line number Diff line change
@@ -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))
}
24 changes: 24 additions & 0 deletions man/get_ifadv.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# summary reports are accurate

Code
report_stats(data)
report_stats(testdata)
Output
### Corpus-level statistics
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-report.R
Original file line number Diff line number Diff line change
@@ -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
)
)
})
4 changes: 2 additions & 2 deletions vignettes/workflows.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5aef8bf

Please sign in to comment.