Skip to content

Commit

Permalink
extend 'twodigitRversion' to handle more types
Browse files Browse the repository at this point in the history
allow passing of `R_system_version` and `character` class objects to
`twodigitRversion`
  • Loading branch information
achubaty committed Nov 7, 2014
1 parent 6b4ae64 commit 54e1ca0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions R/makeRepo.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 54e1ca0

Please sign in to comment.