Skip to content

Commit

Permalink
Further change required when the package was renamed into data.io
Browse files Browse the repository at this point in the history
  • Loading branch information
phgrosjean committed Aug 17, 2018
1 parent a6d6765 commit 60fa0f1
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion R/as_dataframe.R
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ is.dataframe <- is_dataframe
#}
# Test
#library(data.io)
#urchin <- read("urchin_bio", package = "data")
#urchin <- read("urchin_bio", package = "data.io")
#class(urchin)
#library(glue)
#myvar <- "test"
Expand Down
10 changes: 5 additions & 5 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
#' plot(mauna_loa)
#'
#' # Using read(), the dataset becomes an annotated dataframe
#' (ml_en <- read("mauna_loa", package = "data"))
#' (ml_en <- read("mauna_loa", package = "data.io"))
#' class(ml_en)
#'
#' # Indicating lang = "EN_US" (all uppercase!) also converts temperatures
#' # into degrees Farenheit
#' (ml_en_us <- read("mauna_loa", package = "data", lang = "EN_US"))
#' # Each vairable is also labelled:
#' (ml_en_us <- read("mauna_loa", package = "data.io", lang = "EN_US"))
#' # Each variable is also labelled:
#' ml_en$avg_co2
#'
#' # The same in French:
#' (ml_fr <- read("mauna_loa", package = "data", lang = "fr"))
#' (ml_fr <- read("mauna_loa", package = "data.io", lang = "fr"))
#' ml_fr$avg_co2
"mauna_loa"

Expand Down Expand Up @@ -191,7 +191,7 @@

# Summary of datasets available -----------------------------------------------

#' Labelised versions of various datasets provided by 'data' or other packages
#' Labelised versions of various datasets provided by 'data.io' or other packages
#'
#' Use `name <- read("data", package = "pkg", lang = "xx")` to read these
#' datasets together with the metadata (labels, units, comments, ...).
Expand Down
4 changes: 2 additions & 2 deletions R/data_example.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#' Get the path to some example datasets in this package
#'
#' @param path The subpath to a file inside the "extdata" subdirectory of the
#' "data" package.
#' "data.io" package.
#'
#' @description Get the full path to so example datasets included in different
#' formats in the "data" package.
#' formats in the "data.io" package.
#'
#' @return The path to the file, or "" if it is not found.
#' @author Philippe Grosjean <phgrosjean@sciviews.org>
Expand Down
10 changes: 5 additions & 5 deletions R/read.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@
#' # name and syntax more similar to read R datasets and datasets from files)
#' read() # List all available datasets in your installed version of R
#' # List datasets in one particular package
#' read(package = "data")
#' read(package = "data.io")
#'
#' # Read one dataset from this package, possibly changing its name
#' (urchin <- read("urchin_bio", package = "data"))
#' (urchin <- read("urchin_bio", package = "data.io"))
#' # Same, but using labels in French
#' (urchin <- read("urchin_bio", package = "data", lang = "fr"))
#' (urchin <- read("urchin_bio", package = "data.io", lang = "fr"))
#' # ... and also the levels of factors in French (note: uppercase FR)
#' (urchin <- read("urchin_bio", package = "data", lang = "FR"))
#' (urchin <- read("urchin_bio", package = "data.io", lang = "FR"))
#'
#' # Read one dataset from another package, but with labels and comments
#' data(iris) # The R way: you got the initial datasets
Expand Down Expand Up @@ -279,7 +279,7 @@ sidecar_file = TRUE, fun_list = NULL, hfun = NULL, fun = NULL, ...) {
}
script <- trans_script(file, full_lang, main_lang, package)
if (script == "")
script <- trans_script(file, full_lang, main_lang, "data")
script <- trans_script(file, full_lang, main_lang, "data.io")
if (script != "") {# Source it, then run the corresponding function
source(script, local = TRUE, chdir = TRUE, verbose = FALSE,
encoding = lang_encoding)
Expand Down
2 changes: 1 addition & 1 deletion R/relative_path.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#' relative_path("file.txt", "/Users/me/project")
#' relative_path("~/file.txt", "/Users/me/project")
#' relative_path("./file.txt", "/Users/me/project")
#' relative_path(file.path(getwd(), "data", "file.txt"))
#' relative_path(file.path(getwd(), "data.io", "file.txt"))
#' }
relative_path <- function(file, dir = getwd()) {
file2 <- normalizePath(file, winslash = "/", mustWork = FALSE)
Expand Down
4 changes: 2 additions & 2 deletions man/data_example.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/datasets.Rd

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

8 changes: 4 additions & 4 deletions man/mauna_loa.Rd

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

8 changes: 4 additions & 4 deletions man/read.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/relative_path.Rd

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

0 comments on commit 60fa0f1

Please sign in to comment.