From 00f51047195e17e29c5d19bf5d791d527294c3b6 Mon Sep 17 00:00:00 2001 From: phgrosjean Date: Fri, 17 Aug 2018 15:23:20 +0200 Subject: [PATCH] Package name changed from 'data' to 'data.io' --- DESCRIPTION | 10 ++++---- NEWS.md | 4 ++-- R/as_dataframe.R | 2 +- R/{data-package.R => data.io-package.R} | 4 ++-- R/data_example.R | 2 +- README.md | 32 ++++++++++++------------- TODO | 2 +- data-raw/mauna_loa.R | 10 ++++---- data-raw/urchin_bio.R | 4 ++-- data-raw/urchin_growth.R | 4 ++-- data-raw/zooplankton.R | 2 +- man/data-package.Rd | 6 ++--- tests/testthat.R | 2 +- tests/testthat/test-read.R | 2 +- vignettes/SciViews_data.Rmd | 2 +- 15 files changed, 44 insertions(+), 44 deletions(-) rename R/{data-package.R => data.io-package.R} (72%) diff --git a/DESCRIPTION b/DESCRIPTION index 31010fb..319736d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ -Package: data +Package: data.io Type: Package Version: 1.0.0 -Title: Read Data from Files or Datasets in R Packages in Different Formats -Description: Read data from many different formats (tabular datasets, images, +Title: Data Input/Output, Read or Write Data from Files or Datasets in R Packages in Different Formats +Description: Read or write data from many different formats (tabular datasets, images, ...) into R objects. Add labels and units in different languages. Authors@R: c(person("Philippe", "Grosjean", role = c("aut", "cre"), email = "phgrosjean@sciviews.org")) @@ -13,8 +13,8 @@ Suggests: SciViews, readxl, haven, WriteXLS, openxlsx, covr, knitr, testthat License: GPL-2 Encoding: UTF-8 LazyData: true -URL: https://github.com/SciViews/data, http://www.sciviews.org/SciViews-R -BugReports: https://github.com/SciViews/data/issues +URL: https://github.com/SciViews/data.io, http://www.sciviews.org/SciViews-R +BugReports: https://github.com/SciViews/data.io/issues Roxygen: list(markdown = TRUE) RoxygenNote: 6.0.1 VignetteBuilder: knitr diff --git a/NEWS.md b/NEWS.md index 03b5ead..15b54fd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# data News +# data.io News -## Changes in data 1.0.0 +## Changes in data.io 1.0.0 First version of the package on Github. diff --git a/R/as_dataframe.R b/R/as_dataframe.R index ed88fc5..c82d4bb 100644 --- a/R/as_dataframe.R +++ b/R/as_dataframe.R @@ -191,7 +191,7 @@ is.dataframe <- is_dataframe # NextMethod() #} # Test -#library(data) +#library(data.io) #urchin <- read("urchin_bio", package = "data") #class(urchin) #library(glue) diff --git a/R/data-package.R b/R/data.io-package.R similarity index 72% rename from R/data-package.R rename to R/data.io-package.R index 456e3ad..fc71172 100644 --- a/R/data-package.R +++ b/R/data.io-package.R @@ -1,6 +1,6 @@ -#' data - Read Data from Files or Datasets in R Packages in Different Formats +#' data.io - Data Input/Output, Read or Write Data from Files or Datasets in R Packages in Different Formats #' -#' Read data from many different formats (tabular datasets, images, ...) into R +#' Read or write data from many different formats (tabular datasets, images, ...) into R #' objects. #' #' @section Important functions: diff --git a/R/data_example.R b/R/data_example.R index fb166de..a3d3882 100644 --- a/R/data_example.R +++ b/R/data_example.R @@ -15,4 +15,4 @@ #' @examples #' data_example("iris.csv") data_example <- function(path) - system.file("extdata", path, package = "data", mustWork = TRUE) \ No newline at end of file + system.file("extdata", path, package = "data.io", mustWork = TRUE) \ No newline at end of file diff --git a/README.md b/README.md index d59dd6f..767d4b1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# data - SciViews datasets and read()/write() functions +# data.io - SciViews datasets and read()/write() functions -[![Linux & OSX Build Status](https://travis-ci.org/SciViews/data.svg )](https://travis-ci.org/SciViews/data) -[![Win Build Status](https://ci.appveyor.com/api/projects/status/github/SciViews/data?branch=master&svg=true)](http://ci.appveyor.com/project/phgrosjean/data) -[![Coverage Status](https://img.shields.io/codecov/c/github/SciViews/data/master.svg) -](https://codecov.io/github/SciViews/data?branch=master) -[![CRAN Status](http://www.r-pkg.org/badges/version/data)](http://cran.r-project.org/package=data) +[![Linux & OSX Build Status](https://travis-ci.org/SciViews/data.io.svg )](https://travis-ci.org/SciViews/data.io) +[![Win Build Status](https://ci.appveyor.com/api/projects/status/github/SciViews/data.io?branch=master&svg=true)](http://ci.appveyor.com/project/phgrosjean/data.io) +[![Coverage Status](https://img.shields.io/codecov/c/github/SciViews/data.io/master.svg) +](https://codecov.io/github/SciViews/data.io?branch=master) +[![CRAN Status](http://www.r-pkg.org/badges/version/data.io)](http://cran.r-project.org/package=data.io) [![License](https://img.shields.io/badge/license-GPL-blue.svg)](http://www.gnu.org/licenses/gpl-2.0.html) @@ -12,10 +12,10 @@ ### Latest stable version -The latest stable version of **data** can simply be installed from [CRAN](http://cran.r-project.org): +The latest stable version of **data.io** can simply be installed from [CRAN](http://cran.r-project.org): ```r -install.packages("data") +install.packages("data.io") ``` @@ -27,30 +27,30 @@ Make sure you have the **devtools** R package installed: install.packages("devtools") ``` -Use `install_github()` to install the **data** package from Github (source from **master** branch will be recompiled on your machine): +Use `install_github()` to install the **data.io** package from Github (source from **master** branch will be recompiled on your machine): ```r -devtools::install_github("SciViews/data") +devtools::install_github("SciViews/data.io") ``` -R should install all required dependencies automatically, and then it should compile and install **data**. +R should install all required dependencies automatically, and then it should compile and install **data.io**. -Latest devel version of **data** (source + Windows binaires for the latest stable version of R at the time of compilation) is also available from [appveyor](https://ci.appveyor.com/project/phgrosjean/data/build/artifacts). +Latest devel version of **data.io** (source + Windows binaires for the latest stable version of R at the time of compilation) is also available from [appveyor](https://ci.appveyor.com/project/phgrosjean/data.io/build/artifacts). ## Usage -Make the **data** package available in your R session: +Make the **data.io** package available in your R session: ```r -library("data") +library("data.io") ``` Get help about this package: ```r -library(help = "data") -help("data-package") +library(help = "data.io") +help("data.io-package") ``` For further instructions, please, refer to these help pages. diff --git a/TODO b/TODO index fd90dc4..4d0dddc 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -# data To Do list +# data.io To Do list * geyser translation files are missing! diff --git a/data-raw/mauna_loa.R b/data-raw/mauna_loa.R index 9b8c954..def11e2 100644 --- a/data-raw/mauna_loa.R +++ b/data-raw/mauna_loa.R @@ -1,8 +1,8 @@ SciViews::R -library(data) +library(data.io) library(dplyr) library(tidyr) -mauna_loa <- data::read(here::here("data-raw", "mauna_loa.xls"), +mauna_loa <- data.io::read(here::here("data-raw", "mauna_loa.xls"), sheet = "avg_temp",na = "-----", skip = 11L, header = NULL, lang = NULL, as_dataframe = FALSE) %>% select(c(1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24)) %>% @@ -10,7 +10,7 @@ mauna_loa <- data::read(here::here("data-raw", "mauna_loa.xls"), arrange(year) %>% mutate(avg_temp = round((avg_temp - 32) / 1.8, 1)) -mauna_loa$min_temp <- data::read(here::here("data-raw", "mauna_loa.xls"), +mauna_loa$min_temp <- data.io::read(here::here("data-raw", "mauna_loa.xls"), sheet = "min_temp",na = "-----", skip = 11L, header = NULL, lang = NULL, as_dataframe = FALSE) %>% select(c(1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24)) %>% @@ -19,7 +19,7 @@ mauna_loa$min_temp <- data::read(here::here("data-raw", "mauna_loa.xls"), mutate(min_temp = round((min_temp - 32) / 1.8, 1)) %>% pull(min_temp) -mauna_loa$max_temp <- data::read(here::here("data-raw", "mauna_loa.xls"), +mauna_loa$max_temp <- data.io::read(here::here("data-raw", "mauna_loa.xls"), sheet = "max_temp",na = "-----", skip = 11L, header = NULL, lang = NULL, as_dataframe = FALSE) %>% select(c(1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24)) %>% @@ -28,7 +28,7 @@ mauna_loa$max_temp <- data::read(here::here("data-raw", "mauna_loa.xls"), mutate(max_temp = round((max_temp - 32) / 1.8, 1)) %>% pull(max_temp) -mauna_loa$avg_co2 <- data::read(here::here("data-raw", "mauna_loa.xls"), +mauna_loa$avg_co2 <- data.io::read(here::here("data-raw", "mauna_loa.xls"), sheet = "CO2",na = "-99.99", skip = 69L, header = NULL, lang = NULL, as_dataframe = FALSE) %>% mutate(avg_CO2 = round(avg_CO2, 1)) %>% diff --git a/data-raw/urchin_bio.R b/data-raw/urchin_bio.R index a70a6b3..ee982c0 100644 --- a/data-raw/urchin_bio.R +++ b/data-raw/urchin_bio.R @@ -1,6 +1,6 @@ SciViews::R -library(data) -urchin_bio <- data::read(here::here("data-raw", "urchin_bio.xls"), +library(data.io) +urchin_bio <- data.io::read(here::here("data-raw", "urchin_bio.xls"), lang = NULL, as_dataframe = FALSE) urchin_bio$origin <- factor(urchin_bio$origin) urchin_bio$maturity <- as.integer(urchin_bio$maturity) diff --git a/data-raw/urchin_growth.R b/data-raw/urchin_growth.R index 4b3f393..0db1b23 100644 --- a/data-raw/urchin_growth.R +++ b/data-raw/urchin_growth.R @@ -1,6 +1,6 @@ SciViews::R -library(data) -urchin_growth <- data::read(here::here("data-raw", "urchin_growth.xls"), +library(data.io) +urchin_growth <- data.io::read(here::here("data-raw", "urchin_growth.xls"), lang = NULL, as_dataframe = FALSE) urchin_growth$date <- as.Date(urchin_growth$date) comment(urchin_growth) <- NULL diff --git a/data-raw/zooplankton.R b/data-raw/zooplankton.R index 639eb95..2ae2a14 100644 --- a/data-raw/zooplankton.R +++ b/data-raw/zooplankton.R @@ -1,5 +1,5 @@ SciViews::R -library(data) +library(data.io) zooplankton <- readRDS(here::here("data-raw", "zooplankton.rds")) attr(zooplankton, "traindir") <- NULL attr(zooplankton, "path") <- NULL diff --git a/man/data-package.Rd b/man/data-package.Rd index 8d01572..9ee2095 100644 --- a/man/data-package.Rd +++ b/man/data-package.Rd @@ -1,11 +1,11 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data-package.R +% Please edit documentation in R/data.io-package.R \docType{package} \name{data-package} \alias{data-package} -\title{data - Read Data from Files or Datasets in R Packages in Different Formats} +\title{data.io - Data Input/Output, Read or Write Data from Files or Datasets in R Packages in Different Formats} \description{ -Read data from many different formats (tabular datasets, images, ...) into R +Read or write data from many different formats (tabular datasets, images, ...) into R objects. } \section{Important functions}{ diff --git a/tests/testthat.R b/tests/testthat.R index 6f0973f..9bc9425 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,3 +1,3 @@ library("testthat") -test_check("data") +test_check("data.io") diff --git a/tests/testthat/test-read.R b/tests/testthat/test-read.R index 6cc5edb..cf19e81 100644 --- a/tests/testthat/test-read.R +++ b/tests/testthat/test-read.R @@ -3,6 +3,6 @@ context("read") describe("read() R package datasets", { it("reads package datasets when package= argument is provided", { - expect_is(read("urchin_bio", package = "data"), "dataframe") + expect_is(read("urchin_bio", package = "data.io"), "dataframe") }) }) diff --git a/vignettes/SciViews_data.Rmd b/vignettes/SciViews_data.Rmd index edfdc6b..4cb6f1d 100644 --- a/vignettes/SciViews_data.Rmd +++ b/vignettes/SciViews_data.Rmd @@ -17,7 +17,7 @@ knitr::opts_chunk$set( ) ``` -The **data** package provides several example datasets in a standardized way, as well as, a `read()` function to retreive them, or to import external datasets in different formats in an unified way. +The **data.io** package provides several example datasets in a standardized way, as well as, a `read()` function to retreive them, or to import external datasets in different formats in an unified way. There are several datasets spread between various R packages, but there is no clear convention to name them, or their variables, on units to use (some are in metric units, but other ones use the imperial unit system), etc. Here, we propose a set of data, partly converted from other packages, partly new ones, that respect the following conventions: