Quantmod Error 'cannot open URL'
Another (temporary) solution is to call one of the following before the actual getSymbols
script:
options(download.file.method="libcurl")
oroptions(download.file.method="wget")
oroptions(download.file.method="wininet")
The first option works for me (on Mac).
Thanks Paul Gilbert from Rmetrics (bottom post)
Does the quantmod link to yahoo stop working?
Referencing this quantmod issue thread, this is a problem originating from Yahoo, and there is a fix in the development version of quantmod. Until that fix is released on CRAN, you can try installing the development version.
As described in the installation instructions in the quantmod readme:
remotes::install_github("joshuaulrich/quantmod", ref="157_yahoo_502")
# or
devtools::install_github("joshuaulrich/quantmod", ref="157_yahoo_502")
getSymbols() from quantmod in R doesn't work
The latest version of quantmod on CRAN is 0.4-14, so you need to upgrade. Also note that Google Finance no longer provides any data.
You're using MRAN and R-3.3.x. MRAN may have quantmod_0.4-14, but they apparently do not for older R versions. And CRAN only provides Windows binaries for the latest minor version of R (currently 3.6.x).
You can install the latest quantmod from CRAN on R-3.3.x, but you will have to do some of the steps manually. Download quantmod_0.4-14 from CRAN then call:
install.packages("quantmod_0.4-14.tar.gz", repos = NULL, type = "source")
I think that should work. Comment if you still have issues.
Error in getSymbols function usage in R(https)
I tried :
library(quantmod)
# Create an object containing the Pfizer ticker symbol
symbol <- "PFE"
# Use getSymbols to import the data
getSymbols(symbol, src="yahoo", auto.assign=T)
# because src='google' throws error, yahoo was used, and even that is down
When I tried other source, it worked:
# "quantmod::oanda.currencies" contains a list of currencies provided by Oanda.com
currency_pair <- "GBP/CAD"
# Load British Pound to Canadian Dollar exchange rate data
getSymbols(currency_pair, src="oanda")
str(GBPCAD)
It seems there are issues with google and yahoo while we use quantmod pkg.
I will suggest you to use 'Quandl' instead. Plz goto Quandl website, register for free and create API key, and then copy it in below:
# Install Quandl
install.packages("Quandl")
# or from github
install.packages("devtools")
library(devtools)
install_github("quandl/quandl-r")
# Load the Quandl package
library(Quandl)
# use API for full access
Quandl.api_key("xxxxxx")
# Download APPLE stock data
mydata = Quandl::Quandl.datatable("ZACKS/FC", ticker="AAPL")
For HDFC at BSE, you can use:
hdfc = Quandl("BSE/BOM500180")
for more details:
https://www.quandl.com/data/BSE-Bombay-Stock-Exchange?keyword=HDFC
I get an error from R when I run quantmod (getDividens)
Try using lapply
:
library(quantmod)
result <- Reduce(merge, lapply(Tick, function(x) {
tryCatch({
getDividends(x, from= "2016-01-04", to="2017-03-09", src="yahoo")
}, error = function(e) {}
)
}))
Related Topics
C5.0 Decision Tree - C50 Code Called Exit with Value 1
Why Does Rm Inside a Function Not Delete Objects
Add Colored Arrow to Axis of Ggplot2 (Partially Outside Plot Region)
Get the Event Which Is Fired in Shiny
Importing "Csv" File with Multiple-Character Separator to R
Combining Low Frequency Counts
Why Is := Allowed as an Infix Operator
R: Updating a Data Frame with Another Data Frame
Using R to Read Out Excel-Colorinfo
Ggplot2 Overlay of Barplot and Line Plot
Regression (Logistic) in R: Finding X Value (Predictor) for a Particular Y Value (Outcome)
Calculating a Distance Matrix by Dtw
Twitter Data Analysis - Error in Term Document Matrix
In R Combine a List of Lists into One List
How to Put Values on a Boxplot for Median, 1St Quartile and Last Quartile
Update a Dataset After Putting a New Value in the Dt::Datatable