diff --git a/R/makeRepo.R b/R/makeRepo.R index b918ea5..7249fdc 100644 --- a/R/makeRepo.R +++ b/R/makeRepo.R @@ -74,12 +74,19 @@ repoPrefix <- function(type, Rversion){ -twodigitRversion <- function(R = R.version){ - paste(R$major, strsplit(R$minor, ".", fixed = TRUE)[[1L]][1L], sep = ".") +twodigitRversion <- function(R=R.version){ + if("simple.list" %in% is(R)) { + paste(R$major, strsplit(R$minor, ".", fixed = TRUE)[[1L]][1L], sep = ".") + } else if ("R_system_version" %in% is(R)) { + paste(strsplit(as.character(R), ".", fixed=TRUE)[[1L]][1L:2L], collapse=".") + } else if (is.character(R)) { + paste(strsplit(R, ".", fixed=TRUE)[[1L]][1L:2L], collapse=".") + } } + #' Deprecated function to download packages to local folder. #' #' @inheritParams makeRepo