diff --git a/R/TTR-package.R b/R/TTR-package.R index 5ed6d98..7917801 100644 --- a/R/TTR-package.R +++ b/R/TTR-package.R @@ -72,12 +72,13 @@ NULL #' #' ### Note: you must have a working internet connection #' ### for the examples below to work! +#' if (interactive()) { +#' # Fetch U.S. symbols from the internet +#' nyseSymbols <- stockSymbols("NYSE") #' -#' # Fetch U.S. symbols from the internet -#' nyseSymbols <- stockSymbols("NYSE") -#' -#' # Fetch Yahoo! Finance data from the internet -#' ge <- getYahooData("GE", 19990404, 20050607, adjust = FALSE) +#' # Fetch Yahoo! Finance data from the internet +#' ge <- getYahooData("GE", 19990404, 20050607, adjust = FALSE) +#' } #' #'@rdname TTR #'@import xts zoo diff --git a/R/WebData.R b/R/WebData.R index b70419f..1bfc0f5 100644 --- a/R/WebData.R +++ b/R/WebData.R @@ -73,9 +73,11 @@ #' #' ### Note: you must have a working internet #' ### connection for these examples to work! -#' ge <- getYahooData("GE", 19990404, 20050607, adjust = FALSE) +#' if (interactive()) { +#' ge <- getYahooData("GE", 19990404, 20050607, adjust = FALSE) #' -#' nyse.symbols <- stockSymbols("NYSE") +#' nyse.symbols <- stockSymbols("NYSE") +#' } #' #'@section Warning: #'As of TTR 0.23-2, \code{getYahooData} has been patched to work with changes diff --git a/man/TTR.Rd b/man/TTR.Rd index 6d086c1..59fa478 100644 --- a/man/TTR.Rd +++ b/man/TTR.Rd @@ -42,13 +42,13 @@ stochOsc <- stoch(ttrc[,c("High","Low","Close")]) ### Note: you must have a working internet connection ### for the examples below to work! +if (interactive()) { + # Fetch U.S. symbols from the internet + nyseSymbols <- stockSymbols("NYSE") -# Fetch U.S. symbols from the internet -nyseSymbols <- stockSymbols("NYSE") - -# Fetch Yahoo! Finance data from the internet -ge <- getYahooData("GE", 19990404, 20050607, adjust = FALSE) - + # Fetch Yahoo! Finance data from the internet + ge <- getYahooData("GE", 19990404, 20050607, adjust = FALSE) +} } \references{ The following sites were used to code/document this package:\cr diff --git a/man/WebData.Rd b/man/WebData.Rd index ec00f96..45dd930 100644 --- a/man/WebData.Rd +++ b/man/WebData.Rd @@ -92,9 +92,11 @@ to Yahoo Finance, which also included the following changes to the raw data: ### Note: you must have a working internet ### connection for these examples to work! -ge <- getYahooData("GE", 19990404, 20050607, adjust = FALSE) +if (interactive()) { + ge <- getYahooData("GE", 19990404, 20050607, adjust = FALSE) -nyse.symbols <- stockSymbols("NYSE") + nyse.symbols <- stockSymbols("NYSE") +} } \author{