1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 20:02:04 +02:00

(v1.6.0.9002) R-3.0 installation fix

This commit is contained in:
2021-04-12 14:24:40 +02:00
parent 6ff5448192
commit d277d58475
17 changed files with 34 additions and 22 deletions

View File

@ -1095,8 +1095,8 @@ time_track <- function(name = NULL) {
paste("(until now:", trimws(round(as.numeric(Sys.time()) * 1000) - pkg_env$time_start), "ms)")
}
# prevent dependency on package 'backports'
# these functions were not available in previous versions of R (last checked: R 4.0.3)
# prevent dependency on package 'backports' ----
# these functions were not available in previous versions of R (last checked: R 4.0.5)
# see here for the full list: https://github.com/r-lib/backports
strrep <- function(x, times) {
x <- as.character(x)
@ -1143,3 +1143,10 @@ isNamespaceLoaded <- function(pkg) {
lengths <- function(x, use.names = TRUE) {
vapply(x, length, FUN.VALUE = NA_integer_, USE.NAMES = use.names)
}
if (as.double(R.Version()$major) + (as.double(R.Version()$minor) / 10) < 3.1) {
# R-3.0 does not contain these functions, set them here to prevent installation failure
cospi <- function(...) 1
sinpi <- function(...) 1
tanpi <- function(...) 1
}