Skip to content

Commit

Permalink
Package name changed from 'data' to 'data.io'
Browse files Browse the repository at this point in the history
  • Loading branch information
phgrosjean committed Aug 17, 2018
1 parent 489e96c commit 00f5104
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 44 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"))
Expand All @@ -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
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion R/as_dataframe.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions R/data-package.R → R/data.io-package.R
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion R/data_example.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
#' @examples
#' data_example("iris.csv")
data_example <- function(path)
system.file("extdata", path, package = "data", mustWork = TRUE)
system.file("extdata", path, package = "data.io", mustWork = TRUE)
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# 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)


## Installation

### 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")
```


Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# data To Do list
# data.io To Do list

* geyser translation files are missing!

Expand Down
10 changes: 5 additions & 5 deletions data-raw/mauna_loa.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
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)) %>%
gather(month, avg_temp, -year) %>%
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)) %>%
Expand All @@ -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)) %>%
Expand All @@ -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)) %>%
Expand Down
4 changes: 2 additions & 2 deletions data-raw/urchin_bio.R
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions data-raw/urchin_growth.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion data-raw/zooplankton.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions man/data-package.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.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
library("testthat")

test_check("data")
test_check("data.io")
2 changes: 1 addition & 1 deletion tests/testthat/test-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})
})
2 changes: 1 addition & 1 deletion vignettes/SciViews_data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 00f5104

Please sign in to comment.