Skip to content

Commit f8f08fa

Browse files
committed
Switched to interpolation instead of akima
1 parent 1f2bcd9 commit f8f08fa

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Description: All functions and data sets required for the examples in the book
1313
Hyndman (2024) "That's Weird: Anomaly Detection Using R" <https://OTexts.com/weird/>.
1414
All packages needed to run the examples are also loaded.
1515
Imports:
16-
akima,
1716
aplpack,
1817
broom,
1918
cli (>= 1.0.0),
@@ -23,6 +22,7 @@ Imports:
2322
evd,
2423
ggplot2 (>= 3.1.1),
2524
grDevices,
25+
interpolation,
2626
ks,
2727
purrr (>= 0.2.4),
2828
rlang,

NEWS.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# weird 1.0.1
1+
# weird 1.0.2
22

33
* Removed wine_reviews dataset and created `fetch_wine_reviews()` function.
4-
* Switched from interp to akima for bivariate interpolation due to problems on M1.
5-
* Bug fix.
4+
* Bug fixes.
65

76
# weird 1.0.0
87

R/density.R

+2-5
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,8 @@ density_on_grid <- function(y, fy, ngrid) {
121121
))
122122
# Bivariate interpolation
123123
grid <- expand.grid(density$eval.points[[1]], density$eval.points[[2]])
124-
density$estimate <- akima::interpp(
125-
x = y[, 1], y = y[, 2], z = fy,
126-
xo = grid[, 1], yo = grid[, 2]
127-
)$z |>
128-
suppressWarnings() |>
124+
ifun <- interpolation::interpfun(x = y[, 1], y = y[, 2], z = fy)
125+
density$estimate <- ifun(grid[,1], grid[,2]) |>
129126
matrix(nrow = ngrid)
130127
return(density)
131128
}

cran-comments.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Corrected errors reported at <https://cran.r-project.org/web/checks/check_results_weird.html>.
2+
Corrected licensing issues with interpolation imports
23

34
## Test environments
45

0 commit comments

Comments
 (0)