diff --git a/CRAN-RELEASE b/CRAN-RELEASE index 4a67750..ee1f2ba 100644 --- a/CRAN-RELEASE +++ b/CRAN-RELEASE @@ -1,2 +1,2 @@ This package was submitted to CRAN on 2021-09-22. -Once it is accepted, delete this file and tag the release (commit 344a043346). +Once it is accepted, delete this file and tag the release (commit 9f4d26f235). diff --git a/README.Rmd b/README.Rmd index 05ef805..fc9ffbd 100644 --- a/README.Rmd +++ b/README.Rmd @@ -15,8 +15,10 @@ always_allow_html: yes -[![Devel-version](https://img.shields.io/badge/devel%20version-1.1.3-blue.svg)](https://github.com/blasbenito/spatialRF) [![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html) [![CRAN](https://img.shields.io/badge/CRAN-not_published_yet-red)](https://github.com/blasbenito/spatialRF) [![License](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) - +[![Devel-version](https://img.shields.io/badge/devel%20version-1.1.3-blue.svg)](https://github.com/blasbenito/spatialRF) [![lifecycle](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html) +[![CRAN status](https://www.r-pkg.org/badges/version/spatialRF)](https://cran.r-project.org/package=spatialRF)[![License](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) [![DOI](https://zenodo.org/badge/330962704.svg)](https://zenodo.org/badge/latestdoi/330962704) + + diff --git a/README.html b/README.html index 643ec7b..ffa83c2 100644 --- a/README.html +++ b/README.html @@ -634,9 +634,7 @@

spatialRF -

Devel-version lifecycle CRAN License

- - +

Devel-version lifecycle CRAN statusLicense DOI

Introduction

diff --git a/README.md b/README.md index 2ccca90..5646b6e 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,10 @@ [![Devel-version](https://img.shields.io/badge/devel%20version-1.1.3-blue.svg)](https://github.com/blasbenito/spatialRF) -[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html) -[![CRAN](https://img.shields.io/badge/CRAN-not_published_yet-red)](https://github.com/blasbenito/spatialRF) -[![License](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) - +[![lifecycle](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html) +[![CRAN +status](https://www.r-pkg.org/badges/version/spatialRF)](https://cran.r-project.org/package=spatialRF)[![License](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) +[![DOI](https://zenodo.org/badge/330962704.svg)](https://zenodo.org/badge/latestdoi/330962704) diff --git a/docs/authors.html b/docs/authors.html index 7246944..8807d86 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -125,14 +125,14 @@

Citation

pages = {1--17}, doi = {10.18637/jss.v077.i01}, } -

Blas M. Benito (2021). spatialRF: Easy Spatial Regression with Random Forest. R package version 1.1.0. doi: 10.5281/zenodo.4745208. url: https://blasbenito.github.io/spatialRF/

+

Blas M. Benito (2021). R package spatialRF: Easy Spatial Regression with Random Forest. doi: 10.5281/zenodo.4745208. url: https://blasbenito.github.io/spatialRF/

@Manual{,
   title = {spatialRF: Easy Spatial Regression with Random Forest},
   author = {Blas M. Benito},
   doi = {10.5281/zenodo.4745208},
   url = {https://blasbenito.github.io/spatialRF/},
   year = {2021},
-  note = {R package version 1.1.0},
+  note = {R package version 1.1.3},
 }
+ ggplot2::theme_bw() + + ggplot2::labs(color = "Plant richness") + + ggplot2::scale_x_continuous(limits = c(-170, -30)) + + ggplot2::scale_y_continuous(limits = c(-58, 80)) + + ggplot2::ggtitle("Plant richness of the American ecoregions") + + ggplot2::xlab("Longitude") + + ggplot2::ylab("Latitude")

The predictors (columns 5 to 21) represent diverse factors that may influence plant richness such as sampling bias, the area of the ecoregion, climatic variables, human presence and impact, topography, geographical fragmentation, and features of the neighbors of each ecoregion. The figure below shows the scatterplots of the response variable (y axis) against each predictor (x axis).

Note: Every plotting function in the package now allows changing the colors of their main features via specific arguments such as point.color, line.color, or fill.color.

@@ -1157,16 +1157,16 @@

The data frame “per.variable” contains the columns “importance.cv” (median importance), “importance.cv.mad” (median absolute deviation), “importance.cv.percent” (median importance in percentage), and “importance.cv.percent.mad” (median absolute deviation of the importance in percent). The ggplot object “cv.per.variable.plot” contains the importance plot with the median and the median absolute deviation shown above.

The importance computed by random forest on the out-of-bag data by permutating each predictor (as computed by rf()) and the contribution of each predictor to model transferability (as computed by rf_importance()) show a moderate correlation, indicating that both importance measures capture different aspects of the effect of the variables on the model results.

model.non.spatial$importance$per.variable %>%
-  ggplot2::ggplot() +
-  ggplot2::aes(
+  ggplot2::ggplot() +
+  ggplot2::aes(
     x = importance.oob,
     y = importance.cv
   ) +
-  ggplot2::geom_point(size = 3) +
-  ggplot2::theme_bw() +
-  ggplot2::xlab("Importance (out-of-bag)") +
-  ggplot2::ylab("Contribution to transferability") +
-  ggplot2::geom_smooth(method = "lm", formula = y ~ x, color = "red4")
+ ggplot2::geom_point(size = 3) + + ggplot2::theme_bw() + + ggplot2::xlab("Importance (out-of-bag)") + + ggplot2::ylab("Contribution to transferability") + + ggplot2::geom_smooth(method = "lm", formula = y ~ x, color = "red4")

@@ -1388,65 +1388,65 @@

)[1] #plot of climate_bio1_average -p1 <- ggplot2::ggplot() + - ggplot2::geom_sf( +p1 <- ggplot2::ggplot() + + ggplot2::geom_sf( data = world, fill = "white" ) + - ggplot2::geom_point( + ggplot2::geom_point( data = local.importance, - ggplot2::aes( + ggplot2::aes( x = x, y = y, color = climate_bio1_average ) ) + - ggplot2::scale_x_continuous(limits = c(-170, -30)) + - ggplot2::scale_y_continuous(limits = c(-58, 80)) + - ggplot2::scale_color_gradient2( + ggplot2::scale_x_continuous(limits = c(-170, -30)) + + ggplot2::scale_y_continuous(limits = c(-58, 80)) + + ggplot2::scale_color_gradient2( low = color.low, high = color.high ) + - ggplot2::theme_bw() + - ggplot2::theme(legend.position = "bottom") + - ggplot2::ggtitle("climate_bio1_average") + - ggplot2::theme( - plot.title = ggplot2::element_text(hjust = 0.5), - legend.key.width = ggplot2::unit(1,"cm") + ggplot2::theme_bw() + + ggplot2::theme(legend.position = "bottom") + + ggplot2::ggtitle("climate_bio1_average") + + ggplot2::theme( + plot.title = ggplot2::element_text(hjust = 0.5), + legend.key.width = ggplot2::unit(1,"cm") ) + - ggplot2::labs(color = "Importance") + - ggplot2::xlab("Longitude") + - ggplot2::ylab("Latitude") + ggplot2::labs(color = "Importance") + + ggplot2::xlab("Longitude") + + ggplot2::ylab("Latitude") -p2 <- ggplot2::ggplot() + - ggplot2::geom_sf( +p2 <- ggplot2::ggplot() + + ggplot2::geom_sf( data = world, fill = "white" ) + - ggplot2::geom_point( + ggplot2::geom_point( data = local.importance, - ggplot2::aes( + ggplot2::aes( x = x, y = y, color = human_population ) ) + - ggplot2::scale_x_continuous(limits = c(-170, -30)) + - ggplot2::scale_y_continuous(limits = c(-58, 80)) + - ggplot2::scale_color_gradient2( + ggplot2::scale_x_continuous(limits = c(-170, -30)) + + ggplot2::scale_y_continuous(limits = c(-58, 80)) + + ggplot2::scale_color_gradient2( low = color.low, high = color.high ) + - ggplot2::theme_bw() + - ggplot2::theme(legend.position = "bottom") + - ggplot2::ggtitle("human_population") + - ggplot2::theme( - plot.title = ggplot2::element_text(hjust = 0.5), - legend.key.width = ggplot2::unit(1,"cm") + ggplot2::theme_bw() + + ggplot2::theme(legend.position = "bottom") + + ggplot2::ggtitle("human_population") + + ggplot2::theme( + plot.title = ggplot2::element_text(hjust = 0.5), + legend.key.width = ggplot2::unit(1,"cm") ) + - ggplot2::labs(color = "Importance") + - ggplot2::xlab("Longitude") + - ggplot2::ylab("Latitude") + ggplot2::labs(color = "Importance") + + ggplot2::xlab("Longitude") + + ggplot2::ylab("Latitude") p1 + p2

@@ -1781,60 +1781,60 @@

pr[model.non.spatial$evaluation$spatial.folds[[1]]$testing, "group.1"] <- "Testing" pr[model.non.spatial$evaluation$spatial.folds[[25]]$testing, "group.2"] <- "Testing" -p1 <- ggplot2::ggplot() + - ggplot2::geom_sf(data = world, fill = "white") + - ggplot2::geom_point(data = pr, - ggplot2::aes( +p1 <- ggplot2::ggplot() + + ggplot2::geom_sf(data = world, fill = "white") + + ggplot2::geom_point(data = pr, + ggplot2::aes( x = x, y = y, color = group.1 ), size = 2 ) + - ggplot2::scale_color_viridis_d( + ggplot2::scale_color_viridis_d( direction = -1, end = 0.5, alpha = 0.8, option = "F" ) + - ggplot2::theme_bw() + - ggplot2::labs(color = "Group") + - ggplot2::scale_x_continuous(limits = c(-170, -30)) + - ggplot2::scale_y_continuous(limits = c(-58, 80)) + - ggplot2::ggtitle("Spatial fold 1") + - ggplot2::theme( + ggplot2::theme_bw() + + ggplot2::labs(color = "Group") + + ggplot2::scale_x_continuous(limits = c(-170, -30)) + + ggplot2::scale_y_continuous(limits = c(-58, 80)) + + ggplot2::ggtitle("Spatial fold 1") + + ggplot2::theme( legend.position = "none", - plot.title = ggplot2::element_text(hjust = 0.5) + plot.title = ggplot2::element_text(hjust = 0.5) ) + - ggplot2::xlab("Longitude") + - ggplot2::ylab("Latitude") + ggplot2::xlab("Longitude") + + ggplot2::ylab("Latitude") -p2 <- ggplot2::ggplot() + - ggplot2::geom_sf(data = world, fill = "white") + - ggplot2::geom_point(data = pr, - ggplot2::aes( +p2 <- ggplot2::ggplot() + + ggplot2::geom_sf(data = world, fill = "white") + + ggplot2::geom_point(data = pr, + ggplot2::aes( x = x, y = y, color = group.2 ), size = 2 ) + - ggplot2::scale_color_viridis_d( + ggplot2::scale_color_viridis_d( direction = -1, end = 0.5, alpha = 0.8, option = "F" ) + - ggplot2::theme_bw() + - ggplot2::labs(color = "Group") + - ggplot2::scale_x_continuous(limits = c(-170, -30)) + - ggplot2::scale_y_continuous(limits = c(-58, 80)) + - ggplot2::theme( - plot.title = ggplot2::element_text(hjust = 0.5) + ggplot2::theme_bw() + + ggplot2::labs(color = "Group") + + ggplot2::scale_x_continuous(limits = c(-170, -30)) + + ggplot2::scale_y_continuous(limits = c(-58, 80)) + + ggplot2::theme( + plot.title = ggplot2::element_text(hjust = 0.5) ) + - ggplot2::ggtitle("Spatial fold 25") + - ggplot2::xlab("Longitude") + - ggplot2::ylab("") + ggplot2::ggtitle("Spatial fold 25") + + ggplot2::xlab("Longitude") + + ggplot2::ylab("") p1 | p2

@@ -1890,12 +1890,12 @@

p1 <- spatialRF::plot_importance(
   model.non.spatial,
   verbose = FALSE) +
-  ggplot2::ggtitle("Non-spatial model")
+  ggplot2::ggtitle("Non-spatial model")
 
 p2 <- spatialRF::plot_importance(
   model.spatial,
   verbose = FALSE) +
-  ggplot2::ggtitle("Spatial model")
+  ggplot2::ggtitle("Spatial model")
 
 p1 | p2

@@ -2001,47 +2001,47 @@

spatial.predictors <- spatialRF::get_spatial_predictors(model.spatial)
 pr <- data.frame(spatial.predictors, plant_richness_df[, c("x", "y")])
 
-p1 <- ggplot2::ggplot() +
-  ggplot2::geom_sf(data = world, fill = "white") +
-  ggplot2::geom_point(
+p1 <- ggplot2::ggplot() +
+  ggplot2::geom_sf(data = world, fill = "white") +
+  ggplot2::geom_point(
     data = pr,
-    ggplot2::aes(
+    ggplot2::aes(
       x = x,
       y = y,
       color = spatial_predictor_0_2
     ),
     size = 2.5
   ) +
-  ggplot2::scale_color_viridis_c(option = "F") +
-  ggplot2::theme_bw() +
-  ggplot2::labs(color = "Eigenvalue") +
-  ggplot2::scale_x_continuous(limits = c(-170, -30)) +
-  ggplot2::scale_y_continuous(limits = c(-58, 80))  +
-  ggplot2::ggtitle("Variable: spatial_predictor_0_2") +
-  ggplot2::theme(legend.position = "bottom")+
-  ggplot2::xlab("Longitude") +
-  ggplot2::ylab("Latitude")
+  ggplot2::scale_color_viridis_c(option = "F") +
+  ggplot2::theme_bw() +
+  ggplot2::labs(color = "Eigenvalue") +
+  ggplot2::scale_x_continuous(limits = c(-170, -30)) +
+  ggplot2::scale_y_continuous(limits = c(-58, 80))  +
+  ggplot2::ggtitle("Variable: spatial_predictor_0_2") +
+  ggplot2::theme(legend.position = "bottom")+
+  ggplot2::xlab("Longitude") +
+  ggplot2::ylab("Latitude")
 
-p2 <- ggplot2::ggplot() +
-  ggplot2::geom_sf(data = world, fill = "white") +
-  ggplot2::geom_point(
+p2 <- ggplot2::ggplot() +
+  ggplot2::geom_sf(data = world, fill = "white") +
+  ggplot2::geom_point(
     data = pr,
-    ggplot2::aes(
+    ggplot2::aes(
       x = x,
       y = y,
       color = spatial_predictor_0_5,
     ),
     size = 2.5
   ) +
-  ggplot2::scale_color_viridis_c(option = "F") +
-  ggplot2::theme_bw() +
-  ggplot2::labs(color = "Eigenvalue") +
-  ggplot2::scale_x_continuous(limits = c(-170, -30)) +
-  ggplot2::scale_y_continuous(limits = c(-58, 80))  +
-  ggplot2::ggtitle("Variable: spatial_predictor_0_5") +
-  ggplot2::theme(legend.position = "bottom") +
-  ggplot2::xlab("Longitude") +
-  ggplot2::ylab("")
+  ggplot2::scale_color_viridis_c(option = "F") +
+  ggplot2::theme_bw() +
+  ggplot2::labs(color = "Eigenvalue") +
+  ggplot2::scale_x_continuous(limits = c(-170, -30)) +
+  ggplot2::scale_y_continuous(limits = c(-58, 80))  +
+  ggplot2::ggtitle("Variable: spatial_predictor_0_5") +
+  ggplot2::theme(legend.position = "bottom") +
+  ggplot2::xlab("Longitude") +
+  ggplot2::ylab("")
 
 p1 | p2

@@ -2668,6 +2668,8 @@

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index c248457..5932f9a 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -2,5 +2,5 @@ pandoc: 2.11.1.1 pkgdown: 1.5.1 pkgdown_sha: ~ articles: [] -last_built: 2021-09-22T19:50Z +last_built: 2021-09-23T16:08Z diff --git a/docs/reference/plot_evaluation.html b/docs/reference/plot_evaluation.html index b188fdd..01a35ec 100644 --- a/docs/reference/plot_evaluation.html +++ b/docs/reference/plot_evaluation.html @@ -146,7 +146,7 @@

Arg line.color -

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "gray30"

+

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "gray30"

verbose diff --git a/docs/reference/plot_importance.html b/docs/reference/plot_importance.html index eb15099..8207150 100644 --- a/docs/reference/plot_importance.html +++ b/docs/reference/plot_importance.html @@ -117,7 +117,7 @@

Plots the variable importance of a model

-

Plots variable importance scores of rf(), rf_repeat(), and rf_spatial() models. Distributions of importance scores produced with rf_repeat() are plotted using ggplot2::geom_violin, which shows the median of the density estimate rather than the actual median of the data. However, the violin plots are ordered from top to bottom by the real median of the data to make small differences in median importance easier to spot. Ths function does not plot the result of rf_importance() yet, but you can find it under model$importance$cv.per.variable.plot.

+

Plots variable importance scores of rf(), rf_repeat(), and rf_spatial() models. Distributions of importance scores produced with rf_repeat() are plotted using ggplot2::geom_violin, which shows the median of the density estimate rather than the actual median of the data. However, the violin plots are ordered from top to bottom by the real median of the data to make small differences in median importance easier to spot. Ths function does not plot the result of rf_importance() yet, but you can find it under model$importance$cv.per.variable.plot.

plot_importance(
@@ -146,7 +146,7 @@ 

Arg line.color -

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "white"

+

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "white"

verbose diff --git a/docs/reference/plot_moran.html b/docs/reference/plot_moran.html index 182d1ad..6b1689b 100644 --- a/docs/reference/plot_moran.html +++ b/docs/reference/plot_moran.html @@ -146,7 +146,7 @@

Arg line.color -

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "gray30"

+

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "gray30"

option diff --git a/docs/reference/plot_residuals_diagnostics.html b/docs/reference/plot_residuals_diagnostics.html index 5206207..2a52e91 100644 --- a/docs/reference/plot_residuals_diagnostics.html +++ b/docs/reference/plot_residuals_diagnostics.html @@ -143,11 +143,11 @@

Arg line.color -

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "gray30"

+

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "gray30"

fill.color -

Character string, fill color of the bars produced by ggplot2::geom_histogram(). Default: viridis::viridis(4, option = "F", alpha = 0.95 )[2]

+

Character string, fill color of the bars produced by ggplot2::geom_histogram(). Default: viridis::viridis(4, option = "F", alpha = 0.95 )[2]

option diff --git a/docs/reference/plot_training_df.html b/docs/reference/plot_training_df.html index a9350d6..dbced65 100644 --- a/docs/reference/plot_training_df.html +++ b/docs/reference/plot_training_df.html @@ -159,7 +159,7 @@

Arg line.color -

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "gray30"

+

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "gray30"

diff --git a/docs/reference/rf_compare.html b/docs/reference/rf_compare.html index 8edd263..395774b 100644 --- a/docs/reference/rf_compare.html +++ b/docs/reference/rf_compare.html @@ -178,7 +178,7 @@

Arg line.color -

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "gray30"

+

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "gray30"

seed diff --git a/docs/reference/rf_importance.html b/docs/reference/rf_importance.html index 92e6b36..bd92acb 100644 --- a/docs/reference/rf_importance.html +++ b/docs/reference/rf_importance.html @@ -179,7 +179,7 @@

Arg line.color -

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "white"

+

Character string, color of the line produced by ggplot2::geom_smooth(). Default: "white"

seed diff --git a/inst/CITATION b/inst/CITATION index fb06b07..ec4ea6c 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -28,6 +28,6 @@ citEntry( doi = "10.5281/zenodo.4745208", url = "https://blasbenito.github.io/spatialRF/", year = 2021, - note = "R package version 1.1.0", - textVersion = "Blas M. Benito (2021). spatialRF: Easy Spatial Regression with Random Forest. R package version 1.1.0. doi: 10.5281/zenodo.4745208. url: https://blasbenito.github.io/spatialRF/" + note = "R package version 1.1.3", + textVersion = "Blas M. Benito (2021). R package spatialRF: Easy Spatial Regression with Random Forest. doi: 10.5281/zenodo.4745208. url: https://blasbenito.github.io/spatialRF/" )