Skip to content

Commit

Permalink
Remove requireNamespace("jsonlite") checks
Browse files Browse the repository at this point in the history
These are no longer needed since jsonlite is in Imports now.

See #380.
  • Loading branch information
joshuaulrich committed Apr 5, 2023
1 parent 15d0979 commit fb145ee
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
3 changes: 0 additions & 3 deletions R/getOptionChain.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ function(Symbols, Exp=NULL, src="yahoo", ...) {

getOptionChain.yahoo <- function(Symbols, Exp, ...)
{
if(!requireNamespace("jsonlite", quietly=TRUE))
stop("package:",dQuote("jsonlite"),"cannot be loaded.")

NewToOld <- function(x, tz = NULL) {
if(is.null(x) || length(x) < 1)
return(NULL)
Expand Down
2 changes: 0 additions & 2 deletions R/getOptionChain.orats.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
}

getOptionChain.orats <- function(Symbols, Exp, api.key, dte, delta) {
if(!requireNamespace("jsonlite", quietly=TRUE))
stop("package:",dQuote("jsonlite"),"cannot be loaded.")

if (missing(api.key)) {
# Check if they have ORATS_API_KEY defined
Expand Down
12 changes: 0 additions & 12 deletions R/getSymbols.R
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,6 @@ function(Symbols,env,return.class='xts',
from=Sys.Date()-179,
to=Sys.Date(),
...) {
if(!requireNamespace("jsonlite", quietly=TRUE))
stop("package:",dQuote("jsonlite"),"cannot be loaded.")

importDefaults("getSymbols.oanda")
this.env <- environment()
Expand Down Expand Up @@ -1230,11 +1228,6 @@ getSymbols.av <- function(Symbols, env, api.key,
default.return.class <- return.class
default.periodicity <- periodicity

if (!requireNamespace("jsonlite", quietly=TRUE)) {
stop("getSymbols.av: Package", dQuote("jsonlite"), "is required but",
" cannot be loaded.", call.=FALSE)
}

#
# For daily, weekly, and monthly data, timestamps are "yyyy-mm-dd".
# For intraday data, timestamps are "yyyy-mm-dd HH:MM:SS".
Expand Down Expand Up @@ -1429,11 +1422,6 @@ getSymbols.tiingo <- function(Symbols, env, api.key,
default.return.class <- return.class
default.periodicity <- periodicity

if (!requireNamespace("jsonlite", quietly=TRUE)) {
stop("getSymbols.tiingo: Package", dQuote("jsonlite"), "is required but",
" cannot be loaded.", call.=FALSE)
}

downloadOne <- function(sym, default.return.class, default.periodicity) {

return.class <- getSymbolLookup()[[sym]]$return.class
Expand Down

0 comments on commit fb145ee

Please sign in to comment.