Skip to content

Commit

Permalink
change utils.R get_lib to allow package other than rCharts
Browse files Browse the repository at this point in the history
  • Loading branch information
timelyportfolio committed Jun 16, 2014
1 parent 574c92f commit a8c7df4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ get_rCharts_assets <- function(lib){
assets[!grepl('jquery', assets)]
}

get_lib <- function(lib){
get_lib <- function(lib, package = 'rCharts'){
if (grepl("^http", lib)){
return(list(name = basename(lib), url = lib))
}
if (file.exists(lib)){
lib_url <- normalizePath(lib)
lib <- basename(lib_url)
} else {
lib_url <- system.file('libraries', lib, package = 'rCharts')
lib_url <- system.file('libraries', lib, package = package)
}
return(list(name = basename(lib), url = lib_url))
}
Expand Down

0 comments on commit a8c7df4

Please sign in to comment.