Skip to content

Commit

Permalink
"project" to "projects"
Browse files Browse the repository at this point in the history
  • Loading branch information
wibeasley committed Oct 11, 2024
1 parent 2a0f9b5 commit fa71737
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion R/metadata-utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
#' REDCapR::regex_named_captures(pattern = pattern_boxes, text = choices_2)
#' }
#'
#' path_3 <- system.file(package = "REDCapR", "test-data/project/simple/metadata.csv")
#' path_3 <- system.file(package = "REDCapR", "test-data/projects/simple/metadata.csv")
#' ds_metadata_3 <- read.csv(path_3)
#' choices_3 <- ds_metadata_3[ds_metadata_3$field_name=="race", "select_choices_or_calculations"]
#' REDCapR::regex_named_captures(pattern = pattern_boxes, text = choices_3)
Expand Down
8 changes: 4 additions & 4 deletions R/project-simple.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ populate_project_simple <- function(batch = FALSE, verbose = TRUE) {
verbose = verbose
)
path_in_simple <- system.file(
"test-data/project/simple/data.csv",
"test-data/projects/simple/data.csv",
package = "REDCapR"
)

# Write the file to disk (necessary only when you wanted to change the data). Don't uncomment; just run manually.
# returned_object <- redcap_read_oneshot(redcap_uri=uri, token=token, raw_or_label="raw")
# utils::write.csv(returned_object$data, file="./inst/test-data/project/simple/simple-data.csv", row.names=FALSE)
# utils::write.csv(returned_object$data, file="./inst/test-data/projects/simple/simple-data.csv", row.names=FALSE)
# returned_object_metadata <- redcap_metadata_read(redcap_uri=uri, token=token)
# utils::write.csv(returned_object_metadata$data, file="./inst/test-data/project/simple/simple-metadata.csv", row.names=FALSE)
# utils::write.csv(returned_object_metadata$data, file="./inst/test-data/projects/simple/simple-metadata.csv", row.names=FALSE)

# Read in the data in R's memory from a csv file.
ds_to_write <-
readr::read_csv(
path_in_simple,
show_col_types = FALSE
)
# ds_to_write <- utils::read.csv(file="./inst/test-data/project/simple/simple-data.csv")
# ds_to_write <- utils::read.csv(file="./inst/test-data/projects/simple/simple-data.csv")

# Remove the calculated variables.
ds_to_write$age <- NULL
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-metadata-write.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#' ds_to_write <-
#' readr::read_csv(
#' file = system.file(
#' "test-data/project/simple/metadata.csv",
#' "test-data/projects/simple/metadata.csv",
#' package = "REDCapR"
#' ),
#' col_types = readr::cols(.default = readr::col_character())
Expand Down
2 changes: 1 addition & 1 deletion man/metadata_utilities.Rd

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

2 changes: 1 addition & 1 deletion man/redcap_metadata_write.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/test-arm-export.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test_that("Longitudinal Two Arms", {
testthat::skip_on_cran()
credential <- retrieve_credential_testing("longitudinal")

path_expected <- "test-data/project/longitudinal/arm.csv"
path_expected <- "test-data/projects/longitudinal/arm.csv"
expected_data_frame <- read_arms(path_expected)

expected_outcome_message <- "The list of arms was retrieved from the REDCap project in \\d+(\\.\\d+\\W|\\W)seconds\\."
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-event-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test_that("Longitudinal Two Arms", {
testthat::skip_on_cran()
credential <- retrieve_credential_testing("longitudinal")

path_expected <- "test-data/project/longitudinal/event.csv"
path_expected <- "test-data/projects/longitudinal/event.csv"
expected_data_frame <- retrieve_expected_events(path_expected)

expected_outcome_message <- "The list of events was retrieved from the REDCap project in \\d+(\\.\\d+\\W|\\W)seconds\\."
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-metadata-write.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ credential <- retrieve_credential_testing("metadata-write")

# Read in the dictionary in R's memory from a csv file.
path_in <- system.file(
"test-data/project/simple/metadata.csv",
"test-data/projects/simple/metadata.csv",
package = "REDCapR"
)
dictionary_to_write <-
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-read-batch-longitudinal.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test_that("smoke", {
})

test_that("so-example-data-frame-retrieval", {
path_expected <- "test-data/project/longitudinal/expected/so-example-data-frame-retrieval.R"
path_expected <- "test-data/projects/longitudinal/expected/so-example-data-frame-retrieval.R"

actual <- tibble::tibble(a=1:5, b=6:10)

Expand All @@ -43,7 +43,7 @@ test_that("so-example-data-frame-retrieval", {

test_that("default", {
testthat::skip_on_cran()
path_expected <- "test-data/project/longitudinal/expected/default.R"
path_expected <- "test-data/projects/longitudinal/expected/default.R"
expected_outcome_message <- "\\d+ records and \\d+ columns were read from REDCap in \\d+(\\.\\d+\\W|\\W)seconds\\."

###########################
Expand Down Expand Up @@ -89,7 +89,7 @@ test_that("default", {

test_that("filter-numeric", {
testthat::skip_on_cran()
path_expected <- "test-data/project/longitudinal/expected/filter-numeric.R"
path_expected <- "test-data/projects/longitudinal/expected/filter-numeric.R"
expected_outcome_message <- "\\d+ records and \\d+ columns were read from REDCap in \\d+(\\.\\d+\\W|\\W)seconds\\."

filter <- "[bmi] > 25"
Expand Down Expand Up @@ -140,7 +140,7 @@ test_that("filter-numeric", {

test_that("filter-character", {
testthat::skip_on_cran()
path_expected <- "test-data/project/longitudinal/expected/filter-character.R"
path_expected <- "test-data/projects/longitudinal/expected/filter-character.R"
expected_outcome_message <- "\\d+ records and \\d+ columns were read from REDCap in \\d+(\\.\\d+\\W|\\W)seconds\\."

filter <- "[email] = '[email protected]'"
Expand Down

0 comments on commit fa71737

Please sign in to comment.