Skip to content

Commit ce4e7ac

Browse files
authored
Merge pull request #29 from PLAY-behaviorome/0.2.7
Fix download_session_csv() bug and add some tests.
2 parents 164d17c + 2fe8e1d commit ce4e7ac

78 files changed

Lines changed: 6932 additions & 11519 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: databraryapi
22
Type: Package
33
Title: Interacts With the Databrary.org API
4-
Version: 0.2.6
4+
Version: 0.2.7
55
Author: Rick O. Gilmore [aut, cre]
66
Authors@R: person("Rick", "O. Gilmore", email = "rog1@psu.edu",
77
role = c("aut", "cre"))

R/download_session_csv.R

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,34 @@ download_session_csv <- function(vol_id = 1,
1414
vb = FALSE) {
1515
# Error handling
1616
if (length(vol_id) > 1) {
17-
stop("vol_id must have length 1.")
17+
stop("`vol_id` must have length 1.")
1818
}
1919
if ((!is.numeric(vol_id)) || (vol_id <= 0)) {
20-
stop("vol_id must be an integer > 0.")
20+
stop("`vol_id` must be an integer > 0.")
2121
}
2222

23+
if (!is.logical(to_df)) {
24+
stop("`to_df` must be a logical value.")
25+
}
26+
if (length(to_df) > 1) {
27+
stop("`to_df` must have length 1.")
28+
}
29+
30+
if (!is.logical(return_response)) {
31+
stop("`return_response` must be a logical value.")
32+
}
33+
if (length(return_response) > 1) {
34+
stop("`return_response` must have length 1.")
35+
}
36+
37+
if (!is.logical(vb)) {
38+
stop("`vb` must be a logical value.")
39+
}
40+
if (length(vb) > 1) {
41+
stop("`vb` must have length 1.")
42+
}
43+
44+
# Main routines
2345
if (vb)
2446
message(paste0("Downloading spreadsheet from volume ", vol_id))
2547
csv_url <-

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Full package documentation built using `pkgdown` can be found [here](https://PLA
1111
- Install the `devtools` package from CRAN: `install.packages("devtools")` if you have not already done so.
1212
- Load `devtools` into your local environment: `library(devtools)`
1313
- Install the `databraryapi` package via `install_github("PLAY-behaviorome/databraryapi")`. Required dependencies will be installed at this time.
14-
- The latest version is 0.2.6.
14+
- The latest version is 0.2.7.
1515

1616
## Use
1717

docs/404.html

Lines changed: 38 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)