Skip to content

Commit

Permalink
RC 0.1.0 (#8)
Browse files Browse the repository at this point in the history
* Bump version, add CRAN comments

* Update README

* Update misc functions

* Add NEWS.md

* Move to "auto" development mode for pkgdown

* Ignore CRAN releases
  • Loading branch information
juliasilge authored Mar 4, 2021
1 parent 2015c8a commit f4ce65b
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
^cran-comments\.md$
^CRAN-RELEASE$
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: spatialsample
Title: Spatial Resampling Infrastructure
Version: 0.0.0.9000
Version: 0.1.0
Authors@R: c(
person(given = "Julia",
family = "Silge",
Expand All @@ -10,7 +10,7 @@ Authors@R: c(
person("RStudio", role = "cph")
)
Description: Functions and classes for spatial resampling to use with the
'rsample' package, including spatial cross-validation (Brenning, 2012)
'rsample' package, such as spatial cross-validation (Brenning, 2012)
<doi:10.1109/IGARSS.2012.6352393>. The scope of 'rsample' and
'spatialsample' is to provide the basic building blocks for creating and
analyzing resamples of a spatial data set, but neither package includes
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# spatialsample 0.1.0

* Added a `NEWS.md` file to track changes to the package.
14 changes: 2 additions & 12 deletions R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,14 @@ rm_out <- function(x) {
x
}

# Get the indices of the analysis set from the assessment set
## Get the indices of the analysis set from the assessment set
default_complement <- function(ind, n) {
list(analysis = setdiff(1:n, ind),
assessment = unique(ind))
}

## Split, but no names
split_unnamed <- function(x, f) {
out <- split(x, f)
unname(out)
}

dim_rset <- function(x, ...) {
dims <- purrr::map(x$splits, dim)
dims <- do.call("rbind", dims)
dims <- tibble::as_tibble(dims)
id_cols <- grep("^id", colnames(x), value = TRUE)
for (i in seq_along(id_cols)) {
dims[id_cols[i]] <- getElement(x, id_cols[i])
}
dims
}
7 changes: 3 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ theme_set(theme_minimal())
# spatialsample

<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/spatialsample)](https://CRAN.R-project.org/package=spatialsample)
[![R-CMD-check](https://github.com/tidymodels/spatialsample/workflows/R-CMD-check/badge.svg)](https://github.com/tidymodels/spatialsample/actions)
[![Codecov test coverage](https://codecov.io/gh/tidymodels/spatialsample/branch/master/graph/badge.svg)](https://codecov.io/gh/tidymodels/spatialsample?branch=master)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
<!-- badges: end -->

## Introduction
Expand All @@ -36,10 +35,10 @@ Like [rsample](https://rsample.tidymodels.org/), spatialsample provides building

## Installation

~~You can install the released version of spatialsample from [CRAN](https://CRAN.R-project.org) with:~~
You can install the released version of spatialsample from [CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("spatialsample") ## not yet released
install.packages("spatialsample")
```

And the development version from [GitHub](https://github.com/) with:
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@

<!-- badges: start -->

[![CRAN
status](https://www.r-pkg.org/badges/version/spatialsample)](https://CRAN.R-project.org/package=spatialsample)
[![R-CMD-check](https://github.com/tidymodels/spatialsample/workflows/R-CMD-check/badge.svg)](https://github.com/tidymodels/spatialsample/actions)
[![Codecov test
coverage](https://codecov.io/gh/tidymodels/spatialsample/branch/master/graph/badge.svg)](https://codecov.io/gh/tidymodels/spatialsample?branch=master)
[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
<!-- badges: end -->

## Introduction
Expand All @@ -33,11 +31,11 @@ have much memory overhead.

## Installation

~~You can install the released version of spatialsample from
[CRAN](https://CRAN.R-project.org) with:~~
You can install the released version of spatialsample from
[CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("spatialsample") ## not yet released
install.packages("spatialsample")
```

And the development version from [GitHub](https://github.com/) with:
Expand Down
3 changes: 3 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ template:
part_of: <a href="https://tidymodels.org">tidymodels</a>
footer: spatialsample is a part of the <strong>tidymodels</strong> ecosystem, a collection of modeling packages designed with common APIs and a shared philosophy.

development:
mode: auto

home:
strip_header: true

Expand Down
13 changes: 13 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Test environments

* local macOS install: release
* macOS 10.15.7 (on GitHub actions): release
* windows server 2019 10.0.17763 (on GitHub actions): olrel, release
* ubuntu 20.04 (on GitHub actions): oldrel, release, devel
* win-builder: release, devel

## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.
13 changes: 13 additions & 0 deletions tests/testthat/helper-rset.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# ------------------------------------------------------------------------------

dim_rset <- function(x, ...) {
dims <- purrr::map(x$splits, dim)
dims <- do.call("rbind", dims)
dims <- tibble::as_tibble(dims)
id_cols <- grep("^id", colnames(x), value = TRUE)
for (i in seq_along(id_cols)) {
dims[id_cols[i]] <- getElement(x, id_cols[i])
}
dims
}

# ------------------------------------------------------------------------------

test_data <- function() {
data.frame(
x = 1:50,
Expand Down

0 comments on commit f4ce65b

Please sign in to comment.