diff --git a/R/build_url.R b/R/build_url.R
index 41e1567..e7be291 100644
--- a/R/build_url.R
+++ b/R/build_url.R
@@ -3,7 +3,8 @@
#
# Build the url to download climatic data from ftp://palantir.boku.ac.at/Public/ClimateData/
#
-# @param climatic_var Character. Climatic variable to be downloaded. One of 'Tmax', 'Tmin' or 'Prcp'.
+# @param climatic_var Character. Climatic variable to be downloaded. One of 'Tmax',
+# 'Tmin' or 'Prcp'.
# @param year Numeric. Year to download climatic information
#
# @return text string with the url
diff --git a/R/check_server.R b/R/check_server.R
index beb1aba..912175c 100644
--- a/R/check_server.R
+++ b/R/check_server.R
@@ -8,8 +8,8 @@
#'
#' @return TRUE if the server seems available, FALSE otherwise.
#'
-#' @details This function checks access to the latest version of the climatic dataset
-#' (version 4).
+#' @details This function checks access to the latest version of the climatic
+#' dataset (version 4).
#'
#' @export
#'
@@ -53,7 +53,8 @@ check_server <- function(climatic_var = NULL,
data.ok <- try(
R.utils::withTimeout({
suppressMessages(
- get_daily_climate_single(coords, climatic_var, paste0(year, "-01-01"), check_conn = FALSE))
+ get_daily_climate_single(coords, climatic_var, paste0(year, "-01-01"),
+ check_conn = FALSE))
},
timeout = 30, # allow 30 seconds to download this single data point
onTimeout = "silent"), # if time out, return NULL
diff --git a/R/get_daily_climate.R b/R/get_daily_climate.R
index 71ada41..c3be14d 100644
--- a/R/get_daily_climate.R
+++ b/R/get_daily_climate.R
@@ -1,35 +1,40 @@
#' Get daily data for multiple climatic variables
#'
-#' Extract daily climate data (temperature and precipitation) for a given set of points or polygons within Europe.
+#' Extract daily climate data (temperature and precipitation) for a given set of
+#' points or polygons within Europe.
#'
#'
-#' @param coords A [matrix], [data.frame], [tibble::tbl_df-class], [sf::sf()], or [terra::SpatVector()] object
-#' containing point or polygon coordinates in decimal degrees (lonlat/geographic format).
-#' Longitude must fall between -40.5 and 75.5 degrees, and latitude between 25.5 and 75.5 degrees.
+#' @param coords A [matrix], [data.frame], [tibble::tbl_df-class], [sf::sf()], or
+#' [terra::SpatVector()] object containing point or polygon coordinates in decimal
+#' degrees (lonlat/geographic format). Longitude must fall between -40.5 and 75.5
+#' degrees, and latitude between 25.5 and 75.5 degrees.
#' If `coords` is a matrix, it must have only two columns: the first with longitude
#' and the second with latitude data.
-#' If `coords` is a data.frame or a tbl_df, it must contain at least two columns called `lon` and `lat`
-#' with longitude and latitude coordinates, respectively.
-#' @param climatic_var Character. Climatic variables to be downloaded ('Tmax', 'Tmin' or 'Prcp').
-#' Various elements can be concatenated in the vector.
+#' If `coords` is a data.frame or a tbl_df, it must contain at least two columns
+#' called `lon` and `lat` with longitude and latitude coordinates, respectively.
+#' @param climatic_var Character. Climatic variables to be downloaded ('Tmax',
+#' 'Tmin' or 'Prcp'). Various elements can be concatenated in the vector.
#' @param period Either numbers (representing years between 1950 and 2022),
#' or dates in "YYYY-MM-DD" format (to obtain data for specific days).
-#' To specify a sequence of years or dates use the format 'start:end' (e.g. YYYY:YYYY or "YYYY-MM-DD:YYYY-MM-DD", see examples).
-#' Various elements can be concatenated in the vector
-#' (e.g. c(2000:2005, 2010:2015, 2020), c("2000-01-01:2000-01-15", "2000-02-01"))
-#' @param output Character. Either "df", which returns a dataframe with daily climatic values
-#' for each point/polygon, or "raster", which returns [terra::SpatRaster()] objects (within a list when more than one
-#' climatic variable is downloaded).
-#' @param version Numeric. Version of the climate data. It uses the latest version (4) by default.
-#' The former version (3) is also available, for the sake of reproducibility.
+#' To specify a sequence of years or dates use the format 'start:end'
+#' (e.g. YYYY:YYYY or "YYYY-MM-DD:YYYY-MM-DD", see examples). Various elements
+#' can be concatenated in the vector (e.g. c(2000:2005, 2010:2015, 2020),
+#' c("2000-01-01:2000-01-15", "2000-02-01"))
+#' @param output Character. Either "df", which returns a dataframe with daily
+#' climatic values for each point/polygon, or "raster", which returns [terra::SpatRaster()]
+#' objects (within a list when more than one climatic variable is downloaded).
+#' @param version Numeric. Version of the climate data. It uses the latest version (4)
+#' by default. The former version (3) is also available, for the sake of reproducibility.
#' See 'references' for details on the climatic data sets.
-#' @param check_connection Logical. Check the connection to the server before attempting data download?
+#' @param check_connection Logical. Check the connection to the server before
+#' attempting data download?
#'
#' @return Either:
#' - A data.frame (if output = "df")
#' - A [terra::SpatRaster()] object (if output = "raster")
-#' - A list of [terra::SpatRaster()] objects (if output = "raster" and there is more than one `climatic_var`).
+#' - A list of [terra::SpatRaster()] objects (if output = "raster" and there is
+#' more than one `climatic_var`).
#'
#' @export
#'
diff --git a/R/get_daily_climate_single.R b/R/get_daily_climate_single.R
index facee3b..5d5de8e 100644
--- a/R/get_daily_climate_single.R
+++ b/R/get_daily_climate_single.R
@@ -1,15 +1,20 @@
#' Get daily data for one climatic variable
#'
-#' Extract daily climate data (temperature or precipitation) for a given set of points or polygons within Europe.
+#' Extract daily climate data (temperature or precipitation) for a given set of
+#' points or polygons within Europe.
#'
-#' @param climatic_var_single Character. Climatic variable to be downloaded. One of 'Tmax', 'Tmin' or 'Prcp'.
-#' @param output Character. Either "df", which returns a dataframe with daily climatic values
-#' for each point/polygon, or "raster", which returns a [terra::SpatRaster()] object.
-#' @param check_conn Logical. Check the data connection before attempting to download the data?
+#' @param climatic_var_single Character. Climatic variable to be downloaded.
+#' One of 'Tmax', 'Tmin' or 'Prcp'.
+#' @param output Character. Either "df", which returns a dataframe with daily
+#' climatic values for each point/polygon, or "raster", which returns a
+#' [terra::SpatRaster()] object.
+#' @param check_conn Logical. Check the connection to the server before
+#' attempting data download?
#' @inheritParams get_daily_climate
#'
-#' @return A data.frame (if output = "df") or a [terra::SpatRaster()] object (if output = "raster").
+#' @return A data.frame (if output = "df") or a [terra::SpatRaster()] object
+#' (if output = "raster").
#'
#' @keywords internal
#' @noRd
@@ -49,7 +54,8 @@ get_daily_climate_single <- function(coords = NULL,
}
if (climatic_var_single %in% names(coords)) {
- stop("Coords cannot have a column with the same name as ", climatic_var_single, ". Please change it.")
+ stop("Coords cannot have a column with the same name as ", climatic_var_single,
+ ". Please change it.")
}
## coords
@@ -96,7 +102,8 @@ get_daily_climate_single <- function(coords = NULL,
if (terra::geomtype(coords.spatvec) == "polygons") {
- if (sum(suppressWarnings(terra::expanse(coords.spatvec, unit = "km"))) > 10000) { # change limits if needed
+ if (sum(suppressWarnings(terra::expanse(coords.spatvec, unit = "km"))) >
+ 10000) { # change limits if needed
stop("Asking for climate data for too large area. Please reduce the polygon area or download original rasters directly from ftp://palantir.boku.ac.at/Public/ClimateData/ so as not to saturate the server")
}
@@ -172,7 +179,8 @@ get_daily_climate_single <- function(coords = NULL,
#### Extract ####
- message(paste0("\nDownloading ", climatic_var_single, " data... This process might take several minutes"))
+ message(paste0("\nDownloading ", climatic_var_single,
+ " data... This process might take several minutes"))
if (output == "df") {
@@ -190,14 +198,16 @@ get_daily_climate_single <- function(coords = NULL,
out <- subset(out, select = -c(lon, lat))
spatvec.coords <- terra::crds(coords.spatvec, df = TRUE)
names(spatvec.coords) <- c("lon", "lat")
- coords.spatvec.df <- data.frame(terra::as.data.frame(coords.spatvec), spatvec.coords)
+ coords.spatvec.df <- data.frame(terra::as.data.frame(coords.spatvec),
+ spatvec.coords)
}
out <- merge(coords.spatvec.df, out, by.x = "ID_coords", by.y = "ID", all = TRUE)
## Rasters codify NA as very negative values (-32768).
# So, if value <-9000, it is NA
- out[, climatic_var_single] <- ifelse(out[, climatic_var_single] < -9000, NA, out[, climatic_var_single])
+ out[, climatic_var_single] <- ifelse(out[, climatic_var_single] < -9000, NA,
+ out[, climatic_var_single])
## Real climatic values
out[,climatic_var_single] <- out[,climatic_var_single]/100
@@ -307,7 +317,8 @@ reshape_terra_extract <- function(df.wide, climvar) {
df.long <- stats::reshape(df.wide, direction = "long",
idvar = c("ID", "lon", "lat"),
- varying = names(df.wide)[!names(df.wide) %in% c("ID", "lon", "lat")],
+ varying = names(df.wide)[!names(df.wide) %in%
+ c("ID", "lon", "lat")],
timevar = "date")
df.long <- df.long[order(df.long$ID, df.long$date), ]
diff --git a/README.Rmd b/README.Rmd
index c60ffd2..dc0a083 100644
--- a/README.Rmd
+++ b/README.Rmd
@@ -21,10 +21,7 @@ knitr::opts_chunk$set(
-[](https://www.repostatus.org/#active) [](https://github.com/VeruGHub/easyclimate/actions/workflows/R-CMD-check.yaml)
-[](https://hits.dwyl.com/VeruGHub/easyclimate)
-[](https://hits.dwyl.com/VeruGHub/easyclimate)
-
+[](https://www.repostatus.org/#active) [](https://github.com/VeruGHub/easyclimate/actions/workflows/R-CMD-check.yaml) [](https://hits.dwyl.com/VeruGHub/easyclimate) [](https://hits.dwyl.com/VeruGHub/easyclimate)
diff --git a/docs/LICENSE.html b/docs/LICENSE.html
index 4873378..975169a 100644
--- a/docs/LICENSE.html
+++ b/docs/LICENSE.html
@@ -232,27 +232,27 @@
17. Interpretation of Sectio
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
-
<one line to give the program's name and a brief idea of what it does.>
-Copyright (C) <year> <name of author>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
+
<one line to give the program's name and a brief idea of what it does.>
+Copyright (C) <year> <name of author>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
-
<program>Copyright (C) <year><name of author>
-This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type 'show c'for details.
+
<program>Copyright (C) <year><name of author>
+This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type 'show c'for details.
The hypothetical commands show w and show c should show the appropriate parts of the General Public License. Of course, your program’s commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
Sys.time()# to know how much time it takes to download
-## [1] "2023-06-06 11:02:58 CEST"
+## [1] "2023-07-10 12:14:17 CEST"daily<-get_daily_climate( coords =coords,
@@ -148,7 +148,7 @@
Example 2: Introducing co
)Sys.time()
-## [1] "2023-06-06 11:05:48 CEST"
+## [1] "2023-07-10 12:16:53 CEST"kable(head(mat_prcp))
@@ -306,43 +307,43 @@
Example 2: Introducing co
1
-
-5.2264
-
37.35226
+
-5.115934
+
37.35703
2008-01-01
-
2.79
+
0.00
1
-
-5.2264
-
37.35226
+
-5.115934
+
37.35703
2008-01-02
-
20.73
+
20.52
1
-
-5.2264
-
37.35226
+
-5.115934
+
37.35703
2008-01-03
-
6.32
+
6.69
1
-
-5.2264
-
37.35226
+
-5.115934
+
37.35703
2008-01-04
0.00
1
-
-5.2264
-
37.35226
+
-5.115934
+
37.35703
2008-01-05
0.00
1
-
-5.2264
-
37.35226
+
-5.115934
+
37.35703
2008-01-06
0.00
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-1-1.png b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-1-1.png
index f403b78..793a8cd 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-1-1.png and b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-1-1.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-4-1.png b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-4-1.png
index bbd77c4..6b3e08e 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-4-1.png and b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-4-1.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-5-1.png b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-5-1.png
index 928e41a..fe0cd36 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-5-1.png and b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-5-1.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-5-2.png b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-5-2.png
index 8c12c9d..3df22b2 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-5-2.png and b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-5-2.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-6-1.png b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-6-1.png
index 7c219d3..fd18046 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-6-1.png and b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-6-1.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-6-2.png b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-6-2.png
index 486db57..0ea26fa 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-6-2.png and b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-6-2.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-7-1.png b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-7-1.png
index 4842510..b149685 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-7-1.png and b/docs/articles/points-df-mat-sf_files/figure-html/points-df-mat-sf-7-1.png differ
diff --git a/docs/articles/polygons-raster.html b/docs/articles/polygons-raster.html
index d988bc2..ea20e49 100644
--- a/docs/articles/polygons-raster.html
+++ b/docs/articles/polygons-raster.html
@@ -114,7 +114,7 @@
Analysing the climate of an area for a given
coords_t<-vect("POLYGON ((-4.5 41, -4.5 40.5, -5 40.5, -5 41))")Sys.time()# to know how much it takes to download
-## [1] "2023-06-06 11:06:17 CEST"
+## [1] "2023-07-10 12:17:31 CEST"df_tmax<-get_daily_climate(coords_t,
@@ -124,7 +124,7 @@
Analysing the climate of an area for a given
)Sys.time()
-## [1] "2023-06-06 11:06:37 CEST"
+## [1] "2023-07-10 12:18:26 CEST"head(df_tmax)## ID_coords lon lat date Tmax
@@ -172,7 +172,7 @@
Analysing the climate of an area for a given
library(tidyterra)Sys.time()
-## [1] "2023-06-06 11:06:39 CEST"
+## [1] "2023-07-10 12:18:39 CEST"ras_tmax<-get_daily_climate(coords_t,
@@ -182,7 +182,7 @@
Analysing the climate of an area for a given
)Sys.time()
-## [1] "2023-06-06 11:06:58 CEST"
+## [1] "2023-07-10 12:19:26 CEST"ras_tmax## class : SpatRaster
diff --git a/docs/articles/polygons-raster_files/figure-html/polygons-raster-3-1.png b/docs/articles/polygons-raster_files/figure-html/polygons-raster-3-1.png
index 09ea279..1126a32 100644
Binary files a/docs/articles/polygons-raster_files/figure-html/polygons-raster-3-1.png and b/docs/articles/polygons-raster_files/figure-html/polygons-raster-3-1.png differ
diff --git a/docs/articles/polygons-raster_files/figure-html/polygons-raster-4-1.png b/docs/articles/polygons-raster_files/figure-html/polygons-raster-4-1.png
index 2596f5e..a8685a7 100644
Binary files a/docs/articles/polygons-raster_files/figure-html/polygons-raster-4-1.png and b/docs/articles/polygons-raster_files/figure-html/polygons-raster-4-1.png differ
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 910f361..85cb16b 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -1,9 +1,9 @@
-pandoc: 2.19.2
+pandoc: 3.1.1
pkgdown: 2.0.7
pkgdown_sha: ~
articles:
climatic-indices: climatic-indices.html
points-df-mat-sf: points-df-mat-sf.html
polygons-raster: polygons-raster.html
-last_built: 2023-06-06T08:59Z
+last_built: 2023-07-10T10:07Z
diff --git a/docs/reference/check_server.html b/docs/reference/check_server.html
index 7435bde..8e7c61b 100644
--- a/docs/reference/check_server.html
+++ b/docs/reference/check_server.html
@@ -94,8 +94,8 @@
Value
Details
-
This function checks access to the latest version of the climatic dataset
-(version 4).
+
This function checks access to the latest version of the climatic
+dataset (version 4).
diff --git a/docs/reference/get_daily_climate.html b/docs/reference/get_daily_climate.html
index 71db010..caad9dc 100644
--- a/docs/reference/get_daily_climate.html
+++ b/docs/reference/get_daily_climate.html
@@ -1,5 +1,6 @@
-Get daily data for multiple climatic variables — get_daily_climate • easyclimateGet daily data for multiple climatic variables — get_daily_climate • easyclimate
@@ -65,7 +66,8 @@
Get daily data for multiple climatic variables
-
Extract daily climate data (temperature and precipitation) for a given set of points or polygons within Europe.
+
Extract daily climate data (temperature and precipitation) for a given set of
+points or polygons within Europe.
@@ -82,42 +84,45 @@
Get daily data for multiple climatic variables
Arguments
coords
-
A matrix, data.frame, tibble::tbl_df, sf::sf(), or terra::SpatVector() object
-containing point or polygon coordinates in decimal degrees (lonlat/geographic format).
-Longitude must fall between -40.5 and 75.5 degrees, and latitude between 25.5 and 75.5 degrees.
+
A matrix, data.frame, tibble::tbl_df, sf::sf(), or
+terra::SpatVector() object containing point or polygon coordinates in decimal
+degrees (lonlat/geographic format). Longitude must fall between -40.5 and 75.5
+degrees, and latitude between 25.5 and 75.5 degrees.
If coords is a matrix, it must have only two columns: the first with longitude
and the second with latitude data.
-If coords is a data.frame or a tbl_df, it must contain at least two columns called lon and lat
-with longitude and latitude coordinates, respectively.
+If coords is a data.frame or a tbl_df, it must contain at least two columns
+called lon and lat with longitude and latitude coordinates, respectively.
climatic_var
-
Character. Climatic variables to be downloaded ('Tmax', 'Tmin' or 'Prcp').
-Various elements can be concatenated in the vector.
+
Character. Climatic variables to be downloaded ('Tmax',
+'Tmin' or 'Prcp'). Various elements can be concatenated in the vector.
period
Either numbers (representing years between 1950 and 2022),
or dates in "YYYY-MM-DD" format (to obtain data for specific days).
-To specify a sequence of years or dates use the format 'start:end' (e.g. YYYY:YYYY or "YYYY-MM-DD:YYYY-MM-DD", see examples).
-Various elements can be concatenated in the vector
-(e.g. c(2000:2005, 2010:2015, 2020), c("2000-01-01:2000-01-15", "2000-02-01"))
+To specify a sequence of years or dates use the format 'start:end'
+(e.g. YYYY:YYYY or "YYYY-MM-DD:YYYY-MM-DD", see examples). Various elements
+can be concatenated in the vector (e.g. c(2000:2005, 2010:2015, 2020),
+c("2000-01-01:2000-01-15", "2000-02-01"))
output
-
Character. Either "df", which returns a dataframe with daily climatic values
-for each point/polygon, or "raster", which returns terra::SpatRaster() objects (within a list when more than one
-climatic variable is downloaded).
+
Character. Either "df", which returns a dataframe with daily
+climatic values for each point/polygon, or "raster", which returns terra::SpatRaster()
+objects (within a list when more than one climatic variable is downloaded).
version
-
Numeric. Version of the climate data. It uses the latest version (4) by default.
-The former version (3) is also available, for the sake of reproducibility.
+
Numeric. Version of the climate data. It uses the latest version (4)
+by default. The former version (3) is also available, for the sake of reproducibility.
See 'references' for details on the climatic data sets.
check_connection
-
Logical. Check the connection to the server before attempting data download?
+
Logical. Check the connection to the server before
+attempting data download?
A list of terra::SpatRaster() objects (if output = "raster" and there is more than one climatic_var).
+
A list of terra::SpatRaster() objects (if output = "raster" and there is
+more than one climatic_var).
References
diff --git a/docs/sitemap.xml b/docs/sitemap.xml
index a301a3b..24cea6b 100644
--- a/docs/sitemap.xml
+++ b/docs/sitemap.xml
@@ -3,9 +3,6 @@
/404.html
-
- /LICENSE.html
- /articles/climatic-indices.html
@@ -24,6 +21,9 @@
/index.html
+
+ /LICENSE.html
+ /news/index.html
diff --git a/man/check_server.Rd b/man/check_server.Rd
index 77dd171..2bc5c74 100644
--- a/man/check_server.Rd
+++ b/man/check_server.Rd
@@ -20,8 +20,8 @@ TRUE if the server seems available, FALSE otherwise.
Check that the online climate data server is available and working correctly.
}
\details{
-This function checks access to the latest version of the climatic dataset
-(version 4).
+This function checks access to the latest version of the climatic
+dataset (version 4).
}
\examples{
\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
diff --git a/man/easyclimate-package.Rd b/man/easyclimate-package.Rd
index ba124c7..0807a30 100644
--- a/man/easyclimate-package.Rd
+++ b/man/easyclimate-package.Rd
@@ -17,11 +17,11 @@ Useful links:
}
\author{
-\strong{Maintainer}: Verónica Cruz-Alonso \email{veronica.cral@gmail.com} (\href{https://orcid.org/0000-0002-0642-036X}{ORCID}) [copyright holder]
+\strong{Maintainer}: Vernica Cruz-Alonso \email{veronica.cral@gmail.com} (\href{https://orcid.org/0000-0002-0642-036X}{ORCID}) [copyright holder]
Authors:
\itemize{
- \item Francisco Rodríguez-Sánchez (\href{https://orcid.org/0000-0002-7981-1599}{ORCID}) [copyright holder]
+ \item Francisco Rodrguez-Snchez (\href{https://orcid.org/0000-0002-7981-1599}{ORCID}) [copyright holder]
\item Christoph Pucher (\href{https://orcid.org/0000-0002-9269-1907}{ORCID})
\item Paloma Ruiz-Benito (\href{https://orcid.org/0000-0002-2781-5870}{ORCID})
\item Julen Astigarraga (\href{https://orcid.org/0000-0001-9520-3713}{ORCID})
diff --git a/man/get_daily_climate.Rd b/man/get_daily_climate.Rd
index d19a321..02ebc8c 100644
--- a/man/get_daily_climate.Rd
+++ b/man/get_daily_climate.Rd
@@ -14,43 +14,48 @@ get_daily_climate(
)
}
\arguments{
-\item{coords}{A \link{matrix}, \link{data.frame}, \link[tibble:tbl_df-class]{tibble::tbl_df}, \code{\link[sf:sf]{sf::sf()}}, or \code{\link[terra:SpatVector-class]{terra::SpatVector()}} object
-containing point or polygon coordinates in decimal degrees (lonlat/geographic format).
-Longitude must fall between -40.5 and 75.5 degrees, and latitude between 25.5 and 75.5 degrees.
+\item{coords}{A \link{matrix}, \link{data.frame}, \link[tibble:tbl_df-class]{tibble::tbl_df}, \code{\link[sf:sf]{sf::sf()}}, or
+\code{\link[terra:SpatVector-class]{terra::SpatVector()}} object containing point or polygon coordinates in decimal
+degrees (lonlat/geographic format). Longitude must fall between -40.5 and 75.5
+degrees, and latitude between 25.5 and 75.5 degrees.
If \code{coords} is a matrix, it must have only two columns: the first with longitude
and the second with latitude data.
-If \code{coords} is a data.frame or a tbl_df, it must contain at least two columns called \code{lon} and \code{lat}
-with longitude and latitude coordinates, respectively.}
+If \code{coords} is a data.frame or a tbl_df, it must contain at least two columns
+called \code{lon} and \code{lat} with longitude and latitude coordinates, respectively.}
-\item{climatic_var}{Character. Climatic variables to be downloaded ('Tmax', 'Tmin' or 'Prcp').
-Various elements can be concatenated in the vector.}
+\item{climatic_var}{Character. Climatic variables to be downloaded ('Tmax',
+'Tmin' or 'Prcp'). Various elements can be concatenated in the vector.}
\item{period}{Either numbers (representing years between 1950 and 2022),
or dates in "YYYY-MM-DD" format (to obtain data for specific days).
-To specify a sequence of years or dates use the format 'start:end' (e.g. YYYY:YYYY or "YYYY-MM-DD:YYYY-MM-DD", see examples).
-Various elements can be concatenated in the vector
-(e.g. c(2000:2005, 2010:2015, 2020), c("2000-01-01:2000-01-15", "2000-02-01"))}
+To specify a sequence of years or dates use the format 'start:end'
+(e.g. YYYY:YYYY or "YYYY-MM-DD:YYYY-MM-DD", see examples). Various elements
+can be concatenated in the vector (e.g. c(2000:2005, 2010:2015, 2020),
+c("2000-01-01:2000-01-15", "2000-02-01"))}
-\item{output}{Character. Either "df", which returns a dataframe with daily climatic values
-for each point/polygon, or "raster", which returns \code{\link[terra:SpatRaster-class]{terra::SpatRaster()}} objects (within a list when more than one
-climatic variable is downloaded).}
+\item{output}{Character. Either "df", which returns a dataframe with daily
+climatic values for each point/polygon, or "raster", which returns \code{\link[terra:SpatRaster-class]{terra::SpatRaster()}}
+objects (within a list when more than one climatic variable is downloaded).}
-\item{version}{Numeric. Version of the climate data. It uses the latest version (4) by default.
-The former version (3) is also available, for the sake of reproducibility.
+\item{version}{Numeric. Version of the climate data. It uses the latest version (4)
+by default. The former version (3) is also available, for the sake of reproducibility.
See 'references' for details on the climatic data sets.}
-\item{check_connection}{Logical. Check the connection to the server before attempting data download?}
+\item{check_connection}{Logical. Check the connection to the server before
+attempting data download?}
}
\value{
Either:
\itemize{
\item A data.frame (if output = "df")
\item A \code{\link[terra:SpatRaster-class]{terra::SpatRaster()}} object (if output = "raster")
-\item A list of \code{\link[terra:SpatRaster-class]{terra::SpatRaster()}} objects (if output = "raster" and there is more than one \code{climatic_var}).
+\item A list of \code{\link[terra:SpatRaster-class]{terra::SpatRaster()}} objects (if output = "raster" and there is
+more than one \code{climatic_var}).
}
}
\description{
-Extract daily climate data (temperature and precipitation) for a given set of points or polygons within Europe.
+Extract daily climate data (temperature and precipitation) for a given set of
+points or polygons within Europe.
}
\examples{
\dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
diff --git a/vignettes/points-df-mat-sf.Rmd b/vignettes/points-df-mat-sf.Rmd
index c7a8419..a5a6a34 100644
--- a/vignettes/points-df-mat-sf.Rmd
+++ b/vignettes/points-df-mat-sf.Rmd
@@ -105,7 +105,8 @@ temp_long <- daily |>
names_to = "temp_vars",
values_to = "temp_values")
-ggplot(temp_long, aes(x = factor(ID_coords), y = temp_values, fill = temp_vars, color = temp_vars)) +
+ggplot(temp_long, aes(x = factor(ID_coords), y = temp_values,
+ fill = temp_vars, color = temp_vars)) +
geom_violin(size = 1, alpha = .7) +
scale_fill_manual(values = c("#C54A52", "#FAFBC5", "#4B8AB8")) +
scale_color_manual(values = c("#C54A52", "#FAFBC5", "#4B8AB8")) +