Skip to content

Commit

Permalink
standardize file extention of extra.Rmd ...
Browse files Browse the repository at this point in the history
  • Loading branch information
slager committed Apr 20, 2024
1 parent 92f290a commit c7d2879
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions R/use.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @examples
#' if(rmarkdown::pandoc_available()){
#' myfile <- tempfile()
#' file <- system.file("extdata", "tests", "extra.rmd",
#' file <- system.file("extdata", "tests", "extra.Rmd",
#' package = "DataPackageR")
#' raw_data <- system.file("extdata", "tests", "raw_data",
#' package = "DataPackageR")
Expand Down Expand Up @@ -83,7 +83,7 @@ use_raw_dataset <- function(path = NULL, ignore = FALSE) {
#' @examples
#' if(rmarkdown::pandoc_available()){
#' myfile <- tempfile()
#' file <- system.file("extdata", "tests", "extra.rmd",
#' file <- system.file("extdata", "tests", "extra.Rmd",
#' package = "DataPackageR")
#' datapackage_skeleton(
#' name = "datatest",
Expand Down Expand Up @@ -175,7 +175,7 @@ use_processing_script <- function(file = NULL, title = NULL, author = NULL, over
#' @examples
#' if(rmarkdown::pandoc_available()){
#' myfile <- tempfile()
#' file <- system.file("extdata", "tests", "extra.rmd",
#' file <- system.file("extdata", "tests", "extra.Rmd",
#' package = "DataPackageR")
#' datapackage_skeleton(
#' name = "datatest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cars_over_20 = datapackager_object_read("cars_over_20")
print(cars_over_20)
```

This API reads from an environment named `ENVS`, containing `subsetCars` and any other previously built data set objects. It is passed into the render environment of `extra.rmd` by DataPackageR at the `render()` call.
This API reads from an environment named `ENVS`, containing `subsetCars` and any other previously built data set objects. It is passed into the render environment of `extra.Rmd` by DataPackageR at the `render()` call.

## Additional data objects

Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/tests/subsetCars.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ When DataPackageR processes this file, it creates this `cars_over_20` object. Af

1. It compares the objects in the rmarkdown render environment of `subsetCars.Rmd` against the objects listed in the `config.yml` file `objects` property.
2. It finds `cars_over_20` is listed there, so it stores it in a new environment.
3. That environment is passed to subsequent R and Rmd files. Specifically when the `extra.rmd` file is processed, it has access to an environment object that holds all the `objects` (defined in the yaml config) that have already been created and processed. This environment is passed into subsequent scripts at the `render()` call.
3. That environment is passed to subsequent R and Rmd files. Specifically when the `extra.Rmd` file is processed, it has access to an environment object that holds all the `objects` (defined in the yaml config) that have already been created and processed. This environment is passed into subsequent scripts at the `render()` call.

All of the above is done automatically. The user only needs to list the objects to be stored and passed to other scripts in the `config.yml` file.

Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/tests/subsetCars.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ <h1>Storing data set objects and making making accessible to other processing sc
<ol style="list-style-type: decimal">
<li>It compares the objects in the rmarkdown render environment of <code>subsetCars.Rmd</code> against the objects listed in the <code>config.yml</code> file <code>objects</code> property.</li>
<li>It finds <code>cars_over_20</code> is listed there, so it stores it in a new environment.</li>
<li>That environment is passed to subsequent R and Rmd files. Specifically when the <code>extra.rmd</code> file is processed, it has access to an environment object that holds all the <code>objects</code> (defined in the yaml config) that have already been created and processed. This environment is passed into subsequent scripts at the <code>render()</code> call.</li>
<li>That environment is passed to subsequent R and Rmd files. Specifically when the <code>extra.Rmd</code> file is processed, it has access to an environment object that holds all the <code>objects</code> (defined in the yaml config) that have already been created and processed. This environment is passed into subsequent scripts at the <code>render()</code> call.</li>
</ol>
<p>All of the above is done automatically. The user only needs to list the objects to be stored and passed to other scripts in the <code>config.yml</code> file.</p>
<p>The <code>datapackager_object_read()</code> API can be used to retrieve these objects from the environment.</p>
Expand Down
2 changes: 1 addition & 1 deletion man/use_data_object.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/use_processing_script.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/use_raw_dataset.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-conditional-build.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test_that("can add a data item", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
file2 <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
expect_null(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-manual-version-bump.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test_that("manual bump version when data unchanged", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
file2 <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
expect_null(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-pkg_description.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test_that("can_read_pkg_description, data_version", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
file2 <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
datapackage_skeleton(
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-skeleton-data-dependencies.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
context("skeleton")
test_that("data, code, and dependencies are moved into place by skeleton", {
file <- system.file("extdata", "tests", "extra.rmd",
file <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
ancillary <- system.file("extdata", "tests", "rfileTest.R",
Expand Down Expand Up @@ -42,7 +42,7 @@ test_that("data, code, and dependencies are moved into place by skeleton", {
tempdir(),
"datatest",
"data-raw",
"extra.rmd"
"extra.Rmd"
),
winslash = "/"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-skeleton-edgecases.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("datapackage_skeleton errors with no name arg", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
file2 <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
expect_error(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-updating-datapackager-version.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test_that("can update", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
file2 <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
expect_null(
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-use_raw_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ context("test-use_raw_data")

test_that("use_raw_data works as expected", {
myfile <- tempfile()
file <- system.file("extdata", "tests", "extra.rmd",
file <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
ancillary <- system.file("extdata", "tests", "rfileTest.R",
Expand Down Expand Up @@ -55,7 +55,7 @@ test_that("use_raw_data works as expected", {

test_that("use_processing_script works as expected", {
myfile <- tempfile()
file <- system.file("extdata", "tests", "extra.rmd",
file <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
expect_null(
Expand Down Expand Up @@ -108,7 +108,7 @@ test_that("use_processing_script works as expected", {

test_that("use_data_object works as expected", {
myfile <- tempfile()
file <- system.file("extdata", "tests", "extra.rmd",
file <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
expect_null(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-version-bump.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("auto bump version when data unchanged", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
file2 <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
expect_null(
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-version-management-edge-cases.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test_that("data changes but version out of sync", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
file2 <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
expect_null(
Expand All @@ -18,7 +18,7 @@ test_that("data changes but version out of sync", {
)
package_build(file.path(tempdir(), "subsetCars"))
config <- yml_find(file.path(tempdir(), "subsetCars"))
config <- yml_add_files(config, "extra.rmd")
config <- yml_add_files(config, "extra.Rmd")
config <- yml_add_objects(config, "pressure")
file.copy(file2, file.path(tempdir(), "subsetCars", "data-raw"))
yml_write(config)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-yaml-config.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("can add a file", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
file2 <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
expect_null(
Expand All @@ -27,7 +27,7 @@ test_that("can add a file", {
))
))
config <- yml_find(file.path(tempdir(), "subsetCars"))
config <- yml_add_files(config, "extra.rmd")
config <- yml_add_files(config, "extra.Rmd")
yml_write(config)
file.copy(from = file2, file.path(tempdir(), "subsetCars", "data-raw"))
expect_equal(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-yaml-manipulation.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("can remove a data item", {
file <- system.file("extdata", "tests", "subsetCars.Rmd",
package = "DataPackageR"
)
file2 <- system.file("extdata", "tests", "extra.rmd",
file2 <- system.file("extdata", "tests", "extra.Rmd",
package = "DataPackageR"
)
expect_null(
Expand Down
14 changes: 7 additions & 7 deletions tests/testthat/test-yaml.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ test_that("yaml reading, adding, removing, listing, and writing", {
attr(test_config, "path") <- attr(config, "path")
expect_identical(config, test_config)

config <- yml_add_files(config, "extra.rmd")
config <- yml_add_files(config, "extra.Rmd")
test_config <-
structure(list(
configuration = list(
files = list(
subsetCars.Rmd = list(enabled = TRUE),
extra.rmd = list(enabled = TRUE)
extra.Rmd = list(enabled = TRUE)
),
objects = "cars_over_20",
render_root = "dummy"
Expand All @@ -52,7 +52,7 @@ test_that("yaml reading, adding, removing, listing, and writing", {
configuration = list(
files = list(
subsetCars.Rmd = list(enabled = TRUE),
extra.rmd = list(enabled = TRUE)
extra.Rmd = list(enabled = TRUE)
),
objects = "cars_over_20",
render_root = "dummy"
Expand All @@ -69,7 +69,7 @@ test_that("yaml reading, adding, removing, listing, and writing", {
configuration = list(
files = list(
subsetCars.Rmd = list(enabled = TRUE),
extra.rmd = list(enabled = TRUE)
extra.Rmd = list(enabled = TRUE)
),
objects = c(
"cars_over_20",
Expand All @@ -90,7 +90,7 @@ test_that("yaml reading, adding, removing, listing, and writing", {
configuration = list(
files = list(
subsetCars.Rmd = list(enabled = TRUE),
extra.rmd = list(enabled = TRUE)
extra.Rmd = list(enabled = TRUE)
),
objects = "cars_over_20",
render_root = "dummy"
Expand All @@ -104,7 +104,7 @@ test_that("yaml reading, adding, removing, listing, and writing", {
list <- yml_list_files(config)
expect_identical(
list,
c("subsetCars.Rmd", "extra.rmd")
c("subsetCars.Rmd", "extra.Rmd")
)


Expand All @@ -119,7 +119,7 @@ test_that("yaml reading, adding, removing, listing, and writing", {
configuration = list(
files = list(
subsetCars.Rmd = list(enabled = TRUE),
extra.rmd = list(enabled = TRUE)
extra.Rmd = list(enabled = TRUE)
),
objects = "cars_over_20",
render_root = "dummy"
Expand Down

0 comments on commit c7d2879

Please sign in to comment.