From 0d2552efb70d5a13a0d51e1d73c5a99af01121fe Mon Sep 17 00:00:00 2001 From: Andrea Manica Date: Tue, 29 Nov 2022 22:53:42 +0000 Subject: [PATCH] spell checks --- .github/workflows/R-CMD-check.yaml | 2 +- R/download_dataset.R | 2 +- R/get_data_path.R | 2 +- R/get_downloaded_datasets.R | 4 ++-- R/get_ice_mask.R | 2 +- R/get_land_mask.R | 2 +- R/is_region_series.R | 4 ++-- R/location_series.R | 4 ++-- R/location_slice.R | 2 +- R/sample_region_slice.R | 2 +- man/climate_for_locations.Rd | 2 +- man/download_dataset.Rd | 2 +- man/get_data_path.Rd | 2 +- man/get_downloaded_datasets.Rd | 2 +- man/get_ice_mask.Rd | 2 +- man/get_land_mask.Rd | 2 +- man/is_region_series.Rd | 4 ++-- man/location_series.Rd | 2 +- man/sample_region_slice.Rd | 2 +- man/time_series_for_locations.Rd | 2 +- vignettes/a0_pastclim_overview.Rmd | 2 +- vignettes/a2_custom_datasets.Rmd | 8 ++++---- 22 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index bd74f87c..76b77e5c 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -2,7 +2,7 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: [main, master, terra_41] + branches: [main, master, cran_changes] pull_request: branches: [main, master] diff --git a/R/download_dataset.R b/R/download_dataset.R index c19b2cda..f01b8216 100644 --- a/R/download_dataset.R +++ b/R/download_dataset.R @@ -1,4 +1,4 @@ -#' Download palaeoclimatereconstructions. +#' Download palaeoclimate reconstructions. #' #' This function downloads palaeoclimate reconstructions. Files will be stored #' in the data path of `pastclim`, which can be inspected with diff --git a/R/get_data_path.R b/R/get_data_path.R index fb249268..b4ad2cd6 100644 --- a/R/get_data_path.R +++ b/R/get_data_path.R @@ -4,7 +4,7 @@ #' #' The path is stored in an option for `pastclim` named `data_path`. If #' a configuration file was saved when using \code{set_data_path}, the path -#' is retrived from a file named "pastclim_data.txt", which +#' is retrieved from a file named "pastclim_data.txt", which #' is found in the directory returned by #' `tools::R_user_dir("pastclim","config")` (i.e. #' the default configuration directory for the package as set in R >= 4.0). diff --git a/R/get_downloaded_datasets.R b/R/get_downloaded_datasets.R index c01c9912..aa788bda 100644 --- a/R/get_downloaded_datasets.R +++ b/R/get_downloaded_datasets.R @@ -2,7 +2,7 @@ #' #' List the downloaded variable for each dataset. #' -#' @param data_path leave it to NULL to use the default datapath +#' @param data_path leave it to NULL to use the default data_path #' @returns a list of variable names per dataset. #' #' @export @@ -22,4 +22,4 @@ get_downloaded_datasets <- function(data_path = NULL) { ] } downloaded_vars -} \ No newline at end of file +} diff --git a/R/get_ice_mask.R b/R/get_ice_mask.R index 2c7cba3c..9a82b07a 100644 --- a/R/get_ice_mask.R +++ b/R/get_ice_mask.R @@ -1,6 +1,6 @@ #' Get the ice mask for a dataset. #' -#' Get the ice mask for a dataset at a given timepoint. +#' Get the ice mask for a dataset at a given time point. #' #' @param time_bp time slice in years before present (negative) #' @param dataset string defining dataset to be downloaded (a list of possible diff --git a/R/get_land_mask.R b/R/get_land_mask.R index e29b0e0f..440856b2 100644 --- a/R/get_land_mask.R +++ b/R/get_land_mask.R @@ -1,6 +1,6 @@ #' Get the land mask for a dataset. #' -#' Get the land mask for a dataset at a given timepoint. +#' Get the land mask for a dataset at a given time point. #' #' @param time_bp time slice in years before present (negative) #' @param dataset string defining dataset to be downloaded (a list of possible diff --git a/R/is_region_series.R b/R/is_region_series.R index aab4ad81..b8dca74a 100644 --- a/R/is_region_series.R +++ b/R/is_region_series.R @@ -1,11 +1,11 @@ #' Check the object is a valid region series #' #' A region series is a \code{terra::SpatRasterDataset} for which each -#' subdataset is a variable, and all variables have the same number of +#' sub-dataset is a variable, and all variables have the same number of #' time steps. #' #' The standard test only checks that each SpatRaster has the same number of -#' layers. The more thorough test (obtainedwith strict=TRUE) actually checks +#' layers. The more thorough test (obtained with strict=TRUE) actually checks #' that all time steps are identical by comparing the result of #' \code{terra::time} applied to each variable #' diff --git a/R/location_series.R b/R/location_series.R index a20fc540..cb43879e 100644 --- a/R/location_series.R +++ b/R/location_series.R @@ -22,7 +22,7 @@ #' @param path_to_nc the path to the custom nc file containing the palaeoclimate #' reconstructions. All the variables of interest need to be included in #' this file. -#' @returns a data.frame with teh climatic variables of interest +#' @returns a data.frame with the climatic variables of interest #' @export location_series <- @@ -111,7 +111,7 @@ location_series <- #' Deprecated version of \code{location_series} #' #' @param ... arguments to be passed to \code{series} -#' @returns a data.frame with teh climatic variables of interest +#' @returns a data.frame with the climatic variables of interest #' #' @export diff --git a/R/location_slice.R b/R/location_slice.R index 3b97d38a..0fdf1346 100644 --- a/R/location_slice.R +++ b/R/location_slice.R @@ -152,7 +152,7 @@ location_slice <- #' Deprecated version of \code{location_slice} #' #' @param ... arguments to be passed to \code{location_slice} -#' @returns a data.frame with teh climatic variables of interest +#' @returns a data.frame with the climatic variables of interest #' #' @export diff --git a/R/sample_region_slice.R b/R/sample_region_slice.R index 6f106155..6b0a36ae 100644 --- a/R/sample_region_slice.R +++ b/R/sample_region_slice.R @@ -1,6 +1,6 @@ #' Sample points from a region time slice #' -#' This function samples points from a region time slice (i.e. a timepoint). +#' This function samples points from a region time slice (i.e. a time point). #' #' This function wraps \code{terra::spatSample} to appropriate sample the #' \code{terra::SpatRaster} returned diff --git a/man/climate_for_locations.Rd b/man/climate_for_locations.Rd index 7fba68f6..e3648205 100644 --- a/man/climate_for_locations.Rd +++ b/man/climate_for_locations.Rd @@ -10,7 +10,7 @@ climate_for_locations(...) \item{...}{arguments to be passed to \code{location_slice}} } \value{ -a data.frame with teh climatic variables of interest +a data.frame with the climatic variables of interest } \description{ Deprecated version of \code{location_slice} diff --git a/man/download_dataset.Rd b/man/download_dataset.Rd index f78e6d5d..1c785ca9 100644 --- a/man/download_dataset.Rd +++ b/man/download_dataset.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/download_dataset.R \name{download_dataset} \alias{download_dataset} -\title{Download palaeoclimatereconstructions.} +\title{Download palaeoclimate reconstructions.} \usage{ download_dataset(dataset, bio_variables = NULL) } diff --git a/man/get_data_path.Rd b/man/get_data_path.Rd index 535ec4ae..b11e480e 100644 --- a/man/get_data_path.Rd +++ b/man/get_data_path.Rd @@ -19,7 +19,7 @@ This function returns the path where climate reconstructions are stored. \details{ The path is stored in an option for `pastclim` named `data_path`. If a configuration file was saved when using \code{set_data_path}, the path -is retrived from a file named "pastclim_data.txt", which +is retrieved from a file named "pastclim_data.txt", which is found in the directory returned by `tools::R_user_dir("pastclim","config")` (i.e. the default configuration directory for the package as set in R >= 4.0). diff --git a/man/get_downloaded_datasets.Rd b/man/get_downloaded_datasets.Rd index 560ae291..16b07540 100644 --- a/man/get_downloaded_datasets.Rd +++ b/man/get_downloaded_datasets.Rd @@ -7,7 +7,7 @@ get_downloaded_datasets(data_path = NULL) } \arguments{ -\item{data_path}{leave it to NULL to use the default datapath} +\item{data_path}{leave it to NULL to use the default data_path} } \value{ a list of variable names per dataset. diff --git a/man/get_ice_mask.Rd b/man/get_ice_mask.Rd index 9a1acc29..e8806ebb 100644 --- a/man/get_ice_mask.Rd +++ b/man/get_ice_mask.Rd @@ -14,5 +14,5 @@ values can be obtained with \code{get_available_datasets}). This function will not work on custom datasets.} } \description{ -Get the ice mask for a dataset at a given timepoint. +Get the ice mask for a dataset at a given time point. } diff --git a/man/get_land_mask.Rd b/man/get_land_mask.Rd index c12f2af1..01383f30 100644 --- a/man/get_land_mask.Rd +++ b/man/get_land_mask.Rd @@ -14,5 +14,5 @@ values can be obtained with \code{get_available_datasets}). This function will not work on custom datasets.} } \description{ -Get the land mask for a dataset at a given timepoint. +Get the land mask for a dataset at a given time point. } diff --git a/man/is_region_series.Rd b/man/is_region_series.Rd index 0192b1c2..74a22a45 100644 --- a/man/is_region_series.Rd +++ b/man/is_region_series.Rd @@ -18,12 +18,12 @@ TRUE if the object is a region series } \description{ A region series is a \code{terra::SpatRasterDataset} for which each -subdataset is a variable, and all variables have the same number of +sub-dataset is a variable, and all variables have the same number of time steps. } \details{ The standard test only checks that each SpatRaster has the same number of -layers. The more thorough test (obtainedwith strict=TRUE) actually checks +layers. The more thorough test (obtained with strict=TRUE) actually checks that all time steps are identical by comparing the result of \code{terra::time} applied to each variable } diff --git a/man/location_series.Rd b/man/location_series.Rd index 5921d947..bd7355a0 100644 --- a/man/location_series.Rd +++ b/man/location_series.Rd @@ -29,7 +29,7 @@ reconstructions. All the variables of interest need to be included in this file.} } \value{ -a data.frame with teh climatic variables of interest +a data.frame with the climatic variables of interest } \description{ This function extract a time series of local climate for diff --git a/man/sample_region_slice.Rd b/man/sample_region_slice.Rd index 657af855..c1f7715f 100644 --- a/man/sample_region_slice.Rd +++ b/man/sample_region_slice.Rd @@ -24,7 +24,7 @@ a data.frame with the sampled cells and their respective values for the climate variables. } \description{ -This function samples points from a region time slice (i.e. a timepoint). +This function samples points from a region time slice (i.e. a time point). } \details{ This function wraps \code{terra::spatSample} to appropriate sample the diff --git a/man/time_series_for_locations.Rd b/man/time_series_for_locations.Rd index 720b21e0..a612925d 100644 --- a/man/time_series_for_locations.Rd +++ b/man/time_series_for_locations.Rd @@ -10,7 +10,7 @@ time_series_for_locations(...) \item{...}{arguments to be passed to \code{series}} } \value{ -a data.frame with teh climatic variables of interest +a data.frame with the climatic variables of interest } \description{ Deprecated version of \code{location_series} diff --git a/vignettes/a0_pastclim_overview.Rmd b/vignettes/a0_pastclim_overview.Rmd index e322b807..9c265d94 100644 --- a/vignettes/a0_pastclim_overview.Rmd +++ b/vignettes/a0_pastclim_overview.Rmd @@ -17,7 +17,7 @@ knitr::opts_chunk$set( # Install the library -You will need to install the library from Github. For this step, you will need to +You will need to install the library from GitHub. For this step, you will need to use `devtools` (if you haven't done so already, install it from CRAN with `install.packages("devtools")`. Once you have `devtools`, simply use: ```{r install, eval=FALSE} diff --git a/vignettes/a2_custom_datasets.Rmd b/vignettes/a2_custom_datasets.Rmd index 7d8feee1..1a0afcdd 100644 --- a/vignettes/a2_custom_datasets.Rmd +++ b/vignettes/a2_custom_datasets.Rmd @@ -21,7 +21,7 @@ This guide is aimed at formatting data in such a way that they can be used with ## An example: the Trace21k-CHELSEA -Here we provide a simple example of how to format such a dataset in R. We will use a version of the Trace21k dataset, downscaled to 30 arcsecs using the CHELSEA algorithm(available from [this website](https://chelsa-climate.org/chelsa-trace21k/)). The data are stored as geoTIFF files, one file per timestep per variable. First, we need to collate all the files for a given variable (we will use *bio01* as an example) within a single `netcdf` file. As the original files are large, we will illustrate here how do to that for only a few timesteps which were aggregated to 3x3 degrees to keep files sizes small. +Here we provide a simple example of how to format such a dataset in R. We will use a version of the Trace21k dataset, downscaled to 30 arcsecs using the CHELSEA algorithm(available from [this website](https://chelsa-climate.org/chelsa-trace21k/)). The data are stored as geoTIFF files, one file per time step per variable. First, we need to collate all the files for a given variable (we will use *bio01* as an example) within a single `netcdf` file. As the original files are large, we will illustrate here how do to that for only a few time steps which were aggregated to 3x3 degrees to keep files sizes small. We start by translating each geoTIFF into a `netcdf` file. The files have the prefix *CHELSA_TraCE21k_bio01_-**xxx**_V1.0.small.tif*, where **xxx** is the number of the time step. We will only use 3 time step for illustrative purposes. @@ -35,7 +35,7 @@ list_of_tiffs <- file.path(tiffs_path,dir(tiffs_path)) bio01 <- terra::rast(list_of_tiffs) ``` -Now we need to set the time axis of the raster (in this case, reconstructions are every 100 years), and generate some userfriendly names to layers in the raster: +Now we need to set the time axis of the raster (in this case, reconstructions are every 100 years), and generate some user friendly names to layers in the raster: ```{r} terra::time(bio01)<-c(0,-100,-200) @@ -100,8 +100,8 @@ climate_100<-slice_region_series(custom_series, time_bp = -100) terra::plot(climate_100) ``` -Note that these reconstructions include the ocean and the icesheets, and it would -be much better to remove them as they are not needed for most ecological/archaological studies (and +Note that these reconstructions include the ocean and the ice sheets, and it would +be much better to remove them as they are not needed for most ecological/archaeological studies (and it allows for smaller files). # Making the data available to others