Skip to content

Commit

Permalink
1.1.5 (#10)
Browse files Browse the repository at this point in the history
* Drop C++11 requirement
* Drop citEntry
* Drop personList
* Fix README
  • Loading branch information
egarpor authored Aug 19, 2023
1 parent 7b01a98 commit 32ca8ca
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 128 deletions.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 1.1.4
Date: 2022-11-07 19:22:17 UTC
SHA: 08f5e6db576460ccb5249f795e2a8aac669f975b
Version: 1.1.5
Date: 2023-08-19 00:23:24 UTC
SHA: 38368f4f9475e882c076efe63226f1ee0547fbfe
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: rotasym
Type: Package
Title: Tests for Rotational Symmetry on the Hypersphere
Version: 1.1.4
Date: 2022-11-07
Version: 1.1.5
Date: 2023-08-19
Authors@R: c(
person(given = "Eduardo", family = "García-Portugués",
role = c("aut", "cre"), email = "[email protected]",
Expand All @@ -28,5 +28,5 @@ LinkingTo: Rcpp, RcppArmadillo
URL: https://github.com/egarpor/rotasym
BugReports: https://github.com/egarpor/rotasym
Encoding: UTF-8
RoxygenNote: 7.2.0
RoxygenNote: 7.2.3
Roxygen: list(old_usage = TRUE)
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@
* Fix warning in r-devel-linux-x86_64-fedora-clang and r-devel-linux-x86_64-debian-clang.
* Fix bug in `kde_level_set()` (example).

# rotasym 1.1.5

* Drop C++11 requirement to adhere to new CRAN policies.
* Drop `personList()` and `citEntry()`.
8 changes: 4 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ set.seed(123456789)
data_0 <- r_vMF(n = n, mu = theta, kappa = 1)
```

### Specified-$\boldsymbol{\theta}$ case
### Specified-θ case

```{r, specified}
# theta known
Expand All @@ -81,7 +81,7 @@ test_rotasym(data = data_0, theta = theta, type = "loc_vMF")
test_rotasym(data = data_0, theta = theta, type = "hyb_vMF")
```

### Unspecified-$\boldsymbol{\theta}$ case
### Unspecified-θ case

```{r, unspecified}
# theta unknown (employs the spherical mean as estimator)
Expand All @@ -93,9 +93,9 @@ test_rotasym(data = data_0, type = "hyb_vMF")
## Data application: test for the rotational symmetry of sunspots

The data application in García-Portugués, Paindaveine and Verdebout (2020) can
be reproduced through the script [sunspots-births.R](https://github.com/egarpor/rotasym/blob/master/data-raw/sunspots-births.R) (data gathering and preprocessing) and the code snippet below.
be replicated through the script [sunspots-births.R](https://github.com/egarpor/rotasym/blob/master/data-raw/sunspots-births.R) (data gathering and preprocessing) and the code snippet below.

```{r, sunspots_births}
```{r, sunspots_births, fig.show = 'hold'}
# Load data
data("sunspots_births")
sunspots_births$X <-
Expand Down
153 changes: 70 additions & 83 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ GPLv3](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org
[![R build
status](https://github.com/egarpor/rotasym/workflows/R-CMD-check/badge.svg)](https://github.com/egarpor/rotasym/actions)
[![](https://www.r-pkg.org/badges/version/rotasym?color=green)](https://cran.r-project.org/package=rotasym)
[![](http://cranlogs.r-pkg.org/badges/grand-total/rotasym?color=green)](https://cran.r-project.org/package=rotasym)
[![](http://cranlogs.r-pkg.org/badges/last-month/rotasym?color=green)](https://cran.r-project.org/package=rotasym)
[![](http://cranlogs.r-pkg.org/badges/grand-total/rotasym)](https://cran.r-project.org/package=rotasym)
[![](http://cranlogs.r-pkg.org/badges/last-month/rotasym)](https://cran.r-project.org/package=rotasym)

<!-- <img src="" alt="rotasym hexlogo" align="right" width="200" style="padding: 0 15px; float: right;"/> -->

Expand Down Expand Up @@ -56,7 +56,7 @@ set.seed(123456789)
data_0 <- r_vMF(n = n, mu = theta, kappa = 1)
```

### Specified-**θ** case
### Specified-θ case

``` r
# theta known
Expand All @@ -80,7 +80,7 @@ test_rotasym(data = data_0, theta = theta, type = "hyb_vMF")
#> Q_hyb_vMF = 46.329, df = 53, p-value = 0.7297
```

### Unspecified-**θ** case
### Unspecified-θ case

``` r
# theta unknown (employs the spherical mean as estimator)
Expand All @@ -107,7 +107,7 @@ test_rotasym(data = data_0, type = "hyb_vMF")
## Data application: test for the rotational symmetry of sunspots

The data application in García-Portugués, Paindaveine and Verdebout
(2020) can be reproduced through the script
(2020) can be replicated through the script
[sunspots-births.R](https://github.com/egarpor/rotasym/blob/master/data-raw/sunspots-births.R)
(data gathering and preprocessing) and the code snippet below.

Expand Down Expand Up @@ -183,12 +183,6 @@ example("sunspots_births")
#> snspt_+ radius = 1, type = "s", col = "lightblue", alpha = 0.25,
#> snspt_+ lit = FALSE)
#> snspt_+ }
#> Error in dyn.load(dynlib <- getDynlib(dir)) :
#> unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/rgl/libs/rgl.so':
#> dlopen(/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/rgl/libs/rgl.so, 6): Symbol not found: _hb_buffer_add_utf8
#> Referenced from: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/rgl/libs/rgl.so
#> Expected in: flat namespace
#> in /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/rgl/libs/rgl.so
#>
#> snspt_> n_cols <- 100
#>
Expand All @@ -199,12 +193,6 @@ example("sunspots_births")
#> snspt_> if (requireNamespace("rgl")) {
#> snspt_+ rgl::points3d(sunspots_23$X, col = viridisLite::viridis(n_cols)[cuts])
#> snspt_+ }
#> Error in dyn.load(dynlib <- getDynlib(dir)) :
#> unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/rgl/libs/rgl.so':
#> dlopen(/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/rgl/libs/rgl.so, 6): Symbol not found: _hb_buffer_add_utf8
#> Referenced from: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/rgl/libs/rgl.so
#> Expected in: flat namespace
#> in /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/rgl/libs/rgl.so
#>
#> snspt_> # Spörer's law: sunspots at the beginning of the solar cycle (dark blue
#> snspt_> # color) tend to appear at higher latitutes, gradually decreasing to the
Expand All @@ -218,76 +206,75 @@ example("sunspots_births")
#> snspt_> plot(kde <- density(x = V, bw = h, n = 2^13, from = -1, to = 1), col = 1,
#> snspt_+ xlim = c(-1, 1), ylim = c(0, 3), axes = FALSE, main = "",
#> snspt_+ xlab = "Cosines (latitude angles)", lwd = 2)
#>
#> snspt_> at <- seq(-1, 1, by = 0.25)
#>
#> snspt_> axis(2); axis(1, at = at)
#>
#> snspt_> axis(1, at = at, line = 1, tick = FALSE,
#> snspt_+ labels = paste0("(", 90 - round(acos(at) / pi * 180, 1), "º)"))
#>
#> snspt_> rug(V)
#>
#> snspt_> legend("topright", legend = c("Full cycle", "Initial 25% cycle",
#> snspt_+ "Final 25% cycle"),
#> snspt_+ lwd = 2, col = c(1, viridisLite::viridis(12)[c(3, 8)]))
#>
#> snspt_> # Density for the observations within the initial 25% of the cycle
#> snspt_> part1 <- sunspots_23$date < quantile(sunspots_23$date, 0.25)
#>
#> snspt_> V1 <- cosines(X = sunspots_23$X[part1, ], theta = c(0, 0, 1))
#>
#> snspt_> h1 <- bw.SJ(x = V1, method = "dpi")
#>
#> snspt_> lines(kde1 <- density(x = V1, bw = h1, n = 2^13, from = -1, to = 1),
#> snspt_+ col = viridisLite::viridis(12)[3], lwd = 2)
#>
#> snspt_> # Density for the observations within the final 25% of the cycle
#> snspt_> part2 <- sunspots_23$date > quantile(sunspots_23$date, 0.75)
#>
#> snspt_> V2 <- cosines(X = sunspots_23$X[part2, ], theta = c(0, 0, 1))
#>
#> snspt_> h2 <- bw.SJ(x = V2, method = "dpi")
#>
#> snspt_> lines(kde2 <- density(x = V2, bw = h2, n = 2^13, from = -1, to = 1),
#> snspt_+ col = viridisLite::viridis(12)[8], lwd = 2)
#>
#> snspt_> # Computation the level set of a kernel density estimator that contains
#> snspt_> # at least 1 - alpha of the probability (kde stands for an object
#> snspt_> # containing the output of density(x = data))
#> snspt_> kde_level_set <- function(kde, data, alpha) {
#> snspt_+
#> snspt_+ # Estimate c from alpha
#> snspt_+ c <- quantile(approx(x = kde$x, y = kde$y, xout = data)$y, probs = alpha)
#> snspt_+
#> snspt_+ # Begin and end index for the potentially many intervals in the level sets
#> snspt_+ kde_larger_c <- kde$y >= c
#> snspt_+ run_length_kde <- rle(kde_larger_c)
#> snspt_+ begin <- which(diff(kde_larger_c) > 0) + 1
#> snspt_+ end <- begin + run_length_kde$lengths[run_length_kde$values] - 1
#> snspt_+
#> snspt_+ # Return the [a_i, b_i], i = 1, ..., K in the K rows
#> snspt_+ return(cbind(kde$x[begin], kde$x[end]))
#> snspt_+
#> snspt_+ }
#>
#> snspt_> # Level set containing the 90% of the probability, in latitude angles
#> snspt_> 90 - acos(kde_level_set(kde = kde, data = V, alpha = 0.10)) / pi * 180
#> [,1] [,2]
#> [1,] -29.448244 -2.455986
#> [2,] 2.582017 28.123329
#>
#> snspt_> # Modes (in cosines and latitude angles)
#> snspt_> modes <- c(kde$x[kde$x < 0][which.max(kde$y[kde$x < 0])],
#> snspt_+ kde$x[kde$x > 0][which.max(kde$y[kde$x > 0])])
#>
#> snspt_> 90 - acos(modes) / pi * 180
#> [1] -13.69322 16.49001
```

<img src="README/README-sunspots_births-1.png" style="display: block; margin: auto;" />

#>
#> snspt_> at <- seq(-1, 1, by = 0.25)
#>
#> snspt_> axis(2); axis(1, at = at)
#>
#> snspt_> axis(1, at = at, line = 1, tick = FALSE,
#> snspt_+ labels = paste0("(", 90 - round(acos(at) / pi * 180, 1), "º)"))
#>
#> snspt_> rug(V)
#>
#> snspt_> legend("topright", legend = c("Full cycle", "Initial 25% cycle",
#> snspt_+ "Final 25% cycle"),
#> snspt_+ lwd = 2, col = c(1, viridisLite::viridis(12)[c(3, 8)]))
#>
#> snspt_> # Density for the observations within the initial 25% of the cycle
#> snspt_> part1 <- sunspots_23$date < quantile(sunspots_23$date, 0.25)
#>
#> snspt_> V1 <- cosines(X = sunspots_23$X[part1, ], theta = c(0, 0, 1))
#>
#> snspt_> h1 <- bw.SJ(x = V1, method = "dpi")
#>
#> snspt_> lines(kde1 <- density(x = V1, bw = h1, n = 2^13, from = -1, to = 1),
#> snspt_+ col = viridisLite::viridis(12)[3], lwd = 2)
#>
#> snspt_> # Density for the observations within the final 25% of the cycle
#> snspt_> part2 <- sunspots_23$date > quantile(sunspots_23$date, 0.75)
#>
#> snspt_> V2 <- cosines(X = sunspots_23$X[part2, ], theta = c(0, 0, 1))
#>
#> snspt_> h2 <- bw.SJ(x = V2, method = "dpi")
#>
#> snspt_> lines(kde2 <- density(x = V2, bw = h2, n = 2^13, from = -1, to = 1),
#> snspt_+ col = viridisLite::viridis(12)[8], lwd = 2)
#>
#> snspt_> # Computation the level set of a kernel density estimator that contains
#> snspt_> # at least 1 - alpha of the probability (kde stands for an object
#> snspt_> # containing the output of density(x = data))
#> snspt_> kde_level_set <- function(kde, data, alpha) {
#> snspt_+
#> snspt_+ # Estimate c from alpha
#> snspt_+ c <- quantile(approx(x = kde$x, y = kde$y, xout = data)$y, probs = alpha)
#> snspt_+
#> snspt_+ # Begin and end index for the potentially many intervals in the level sets
#> snspt_+ kde_larger_c <- kde$y >= c
#> snspt_+ run_length_kde <- rle(kde_larger_c)
#> snspt_+ begin <- which(diff(kde_larger_c) > 0)
#> snspt_+ end <- begin + run_length_kde$lengths[run_length_kde$values] - 1
#> snspt_+
#> snspt_+ # Return the [a_i, b_i], i = 1, ..., K in the K rows
#> snspt_+ return(cbind(kde$x[begin], kde$x[end]))
#> snspt_+
#> snspt_+ }
#>
#> snspt_> # Level set containing the 90% of the probability, in latitude angles
#> snspt_> 90 - acos(kde_level_set(kde = kde, data = V, alpha = 0.10)) / pi * 180
#> [,1] [,2]
#> [1,] -29.464311 -2.469989
#> [2,] 2.568013 28.107467
#>
#> snspt_> # Modes (in cosines and latitude angles)
#> snspt_> modes <- c(kde$x[kde$x < 0][which.max(kde$y[kde$x < 0])],
#> snspt_+ kde$x[kde$x > 0][which.max(kde$y[kde$x > 0])])
#>
#> snspt_> 90 - acos(modes) / pi * 180
#> [1] -13.69322 16.49001

## References

García-Portugués, E., Paindaveine, D., and Verdebout, T. (2020). On
Expand Down
Binary file modified README/README-sunspots_births-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 10 additions & 18 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,17 @@ This is a submission to fix the problems shown on https://cran.r-project.org/web

## Test environments

* local R installation, R 4.1.0
* ubuntu 16.04 (on travis-ci), R 3.4.0
* local R installation, R 4.2.2
* win-builder (release, devel)
* Windows Server 2008 R2 SP1, R-devel, 32/64 bit (on R-hub)
* Windows Server 2008 R2 SP1, R-release, 32/64 bit (on R-hub)
* Windows Server 2008 R2 SP1, R-oldrel, 32/64 bit (on R-hub)
* Ubuntu Linux 16.04 LTS, R-release, GCC (on R-hub)
* Fedora Linux, R-devel, clang, gfortran (on R-hub)
* Debian Linux, R-devel, GCC ASAN/UBSAN (on R-hub)
* macOS 10.13.6 High Sierra, R-release, brew (on R-hub)
* macOS 10.13.6 High Sierra, R-release, CRAN's setup (on R-hub)
* Oracle Solaris 10, x86, 32 bit, R-release (on R-hub)
* Oracle Solaris 10, x86, 32 bit, R-release, Oracle Developer Studio 12.6 (on R-hub)

On some platforms:

* "Found the following (possibly) invalid URLs" -- double-checked and correctly spelled
* Windows Server 2022, R-release, 32/64 bit
* Windows Server 2022, R-devel, 64 bit
* Windows Server 2022, R-oldrel, 32/64 bit
* Windows Server 2022, R-patched, 32/64 bit
* Ubuntu Linux 20.04.1 LTS, R-release, GCC
* Ubuntu Linux 20.04.1 LTS, R-devel, GCC
* Debian Linux, R-release, GCC
* Debian Linux, R-devel, GCC

## R CMD check results

0 errors | 0 warnings | 0 notes

0 errors | 0 warnings | 0 notes
18 changes: 10 additions & 8 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ note <- paste("R package version", meta$Version)

citHeader("To cite rotasym in publications use:")

citEntry(entry = "Manual",
bibentry(
bibtype = "Manual",
title = "{rotasym}: Tests for Rotational Symmetry on the Hypersphere",
author = personList(as.person("Eduardo Garc\\'ia-Portugu\\'es"),
as.person("Davy Paindaveine"),
as.person("Thomas Verdebout")),
author = c(person(given = "Eduardo", family = "García-Portugués"),
person(given = "Davy", family = "Paindaveine"),
person(given = "Thomas", family = "Verdebout")),
year = year,
note = note,
url = "https://CRAN.R-project.org/package=rotasym",
Expand All @@ -18,11 +19,12 @@ citEntry(entry = "Manual",
paste0(note, "."), "https://CRAN.R-project.org/package=rotasym")
)

citEntry(entry = "Article",
bibentry(
bibtype = "Article",
title = "On optimal tests for rotational symmetry against new classes of hyperspherical distributions",
author = personList(as.person("Eduardo Garc\\'ia-Portugu\\'es"),
as.person("Davy Paindaveine"),
as.person("Thomas Verdebout")),
author = c(person(given = "Eduardo", family = "García-Portugués"),
person(given = "Davy", family = "Paindaveine"),
person(given = "Thomas", family = "Verdebout")),
journal = "Journal of the American Statistical Association",
year = "2020",
volume = "115",
Expand Down
4 changes: 0 additions & 4 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
## Set PKG_LIBS
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

## With R 3.1.0 or later, you can uncomment the following line to tell R to
## enable compilation with C++11 (or even C++14) where available
CXX_STD = CXX11
4 changes: 0 additions & 4 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
## Set PKG_LIBS
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

## With R 3.1.0 or later, you can uncomment the following line to tell R to
## enable compilation with C++11 (or even C++14) where available
CXX_STD = CXX11
1 change: 0 additions & 1 deletion src/vMF.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

#include <RcppArmadillo.h>
// [[Rcpp::depends("RcppArmadillo")]]
// [[Rcpp::plugins("cpp11")]]
#include <Rmath.h>
#include <R.h>
using namespace Rcpp;
Expand Down

0 comments on commit 32ca8ca

Please sign in to comment.