-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'cran_changes' into dev
- Loading branch information
Showing
98 changed files
with
852 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: pastclim | ||
Type: Package | ||
Title: Manipulate Time Series of Palaeoclimate Reconstructions | ||
Version: 1.2.0 | ||
Version: 1.2.1 | ||
Authors@R: c( | ||
person("Michela", "Leonardi", role = "aut"), | ||
person(c("Emily","Y."), "Hallet", role = "ctb"), | ||
|
@@ -11,8 +11,9 @@ Authors@R: c( | |
email = "[email protected]") | ||
) | ||
Maintainer: Andrea Manica <[email protected]> | ||
Description: This R package is designed to provide an easy way to extract and manipulate palaeoclimate | ||
reconstructions for ecological and anthropological analyses. | ||
Description: Methods to easily extract and manipulate palaeoclimate | ||
reconstructions for ecological and anthropological analyses, as described | ||
in Leonardi et al. (2022) <doi:10.1101/2022.05.18.492456>. | ||
License: CC BY 4.0 | ||
Language: en-GB | ||
URL: https://github.com/EvolEcolGroup/pastclim, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#' Get the data path where climate reconstructions are stored | ||
#' | ||
#' This function returns the path where climate reconstructions are stored. | ||
#' | ||
#' 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 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). | ||
#' | ||
#' @param silent boolean on whether a message is returned when data_path is | ||
#' not set (i.e. equal to NULL) | ||
#' @returns the data path | ||
#' @export | ||
|
||
get_data_path <- function(silent=FALSE) { | ||
# if the package already initiliased | ||
if (!is.null(getOption("pastclim.data_path"))) { | ||
return(getOption("pastclim.data_path")) | ||
} else { # get the info from the config file | ||
# if the path was not set yet, return a message | ||
if (!file.exists(file.path( | ||
tools::R_user_dir("pastclim", "config"), | ||
"pastclim_data.txt" | ||
))) { | ||
if (!silent) { | ||
message("A default data_path was not set for pastclim;\n", | ||
"use `set_data_path()` to set it.") | ||
} | ||
return(NULL) | ||
} | ||
path_to_nc <- utils::read.table(file.path( | ||
tools::R_user_dir("pastclim", "config"), | ||
"pastclim_data.txt" | ||
))[1, 1] | ||
if (!dir.exists(path_to_nc)){ | ||
stop("The path ",path_to_nc," from the config file does not exist!\n", | ||
"You can reset the path with `set_data_path`.") | ||
} | ||
return(path_to_nc) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.