joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
829 stars 225 forks source link

getSymbols.yahoo() always throws "Error in new.session()" #358

Closed abernal30 closed 2 years ago

abernal30 commented 2 years ago

Description

When applying the function getSymbols(), it errors and does not return a result.

Minimal, reproducible example

getSymbols("AAPL")
## Error in new.session() : Could not establish session after 5 attempts.
pverspeelt commented 2 years ago

@joshuaulrich,

The issue is located in the function .getHandle and specifically in the local function new.session. All the 5 calls to the yahoo website return with no cookies, hence the function fails.

Looking over the code. I don't see much point in the .gethandle function as the yahoo query is also being built in the .yahooURL function. The only thing that .gethandle gives to .yahooURL is the crumb request to the query.srv. and cb has the value: "" for either query1 or query2. So this part is not needed to get the data.

Removing the .gethandle and removing the crumb part from building the yahoo url in .yahooURL returns the data without any issues.

mpadge commented 2 years ago

seeing same issue here

alihru commented 2 years ago

one also needs to get rid of the if statement inside the .getHandle function which stops the process if the number of cookies is zero

if (NROW(curl::handle_cookies(h)) ==0 stop(„Could not establish session after 5 attempts.“)

p.s. thank you for the quick fix! Really appreciate it

joshuaulrich commented 2 years ago

@pverspeelt and @alihru thanks for taking a look! I have a patch and am running CRAN and reverse-dependency checks now.

msperlin commented 2 years ago

Thanks for helping out @joshuaulrich . Im the author of BatchGetSymbols, which uses quantmod::getSymbols(), and got lots of emails this morning about the issue!

ThomasTranGithub commented 2 years ago

Seeing the same issue here.

datawookie commented 2 years ago

@joshuaulrich just confirming that I have tested the fix on the 358-getsymbols-new.session branch and it works for me. :+1: Thank you for responding so quickly! :1st_place_medal:

asaeb1480 commented 2 years ago

what's the solution? These comments are not working!

datawookie commented 2 years ago

@asaeb1480 please try installing from the 358-getsymbols-new.session branch. It's working for me again.

asaeb1480 commented 2 years ago

What's the exact code for installation of 358-getsymbols-new.session plz?

datawookie commented 2 years ago

@asaeb1480 please look at https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html.

joshuaulrich commented 2 years ago

remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session")

m1270 commented 2 years ago

Thank you @joshuaulrich

I can't install it due to this error:

Error: package ‘xts’ 0.12.1 was found, but > 0.12.1 is required by ‘quantmod’

The latest version of xts package is 0.12.1. I am running ubuntu 20.04 and R version of 4.1.2

joshuaulrich commented 2 years ago

@m1270 ah, that's because I have a change in development to move the S4 xts/zoo class to xts... I need to revert that. Thanks for the catch!

fededemo commented 2 years ago

Thanks joshua. getSymbols working now. @m1270 working for me with an remotes::install_github("joshuaulrich/xts", force = TRUE)

mik3hall commented 2 years ago

That installs but doesn't appear to fix for me.

TommyTorstP commented 2 years ago

I have the same issue as @mik3hall here! I tried to find it in the given directory on the computer, but the file still seems to be deleted once install is complete

asaeb1480 commented 2 years ago

Thanks, Joshuaulrich. It's working for me.

mik3hall commented 2 years ago

@TommyTorstP it is in the user library path that it indicated in the install but I must not default search that. Looking at how I can include that now. I assume it will eventually cran install to a normal system path.

pawatkins commented 2 years ago

Hello,

I'm very sorry but I'm an idiot when it comes to this stuff. I'm currently enrolled in a master's class but I've only been coding since January 2022.

I have a project due tonight at midnight and it uses quantmod.

How can I fix this error? I'm in Rstudio

Thanks in advance. I know this has to be work.

joshuaulrich commented 2 years ago

@pawatkins remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session")

Baroni77 commented 2 years ago

after a bit of experimenting, it is working for me too. Thanks @joshuaulrich!

m1270 commented 2 years ago

Thank you @joshuaulrich I confirm it is working for me as well.

MiraiLi00 commented 2 years ago

Hello, @joshuaulrich, thank you for helping with this issue, but I was trying to run the code you provided, but it is still not working for me and it gives me this error:

ERROR: package installation failed Error: Failed to install 'quantmod' from GitHub: System command 'Rcmd.exe' failed, exit status: 1, stdout & stderr were printed

(sorry I am new to this)

Do you know what could be a problem?

mik3hall commented 2 years ago

@TommyTorstP Still not working for me.

Installed to... installing to /Users/mjh/Library/R/x86_64/4.1/library/00LOCK-xts/00new/xts/libs

portfolio <- c("SPY","ORCL","FCX","X","MRO","ZIM","USO") from.dat <- as.Date("01/01/22", format="%m/%d/%y") getSymbols(portfolio,from=from.dat,auto.assign=T) ‘getSymbols’ currently uses auto.assign=TRUE by default, but will use auto.assign=FALSE in 0.5-0. You will still be able to use ‘loadSymbols’ to automatically load data. getOption("getSymbols.env") and getOption("getSymbols.auto.assign") will still be checked for alternate defaults.

This message is shown once per session and may be disabled by setting options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.

Error in new.session() : Could not establish session after 5 attempts.

.libPaths() [1] "/Users/mjh/Library/R/x86_64/4.1/library" "/Library/Frameworks/R.framework/Versions/4.1/Resources/library"

eddelbuettel commented 2 years ago

@joshuaulrich methinks you still have the wrong xts constraint for general installations:

edd@rob:~$ Rscript -e 'remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session")'
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo joshuaulrich/quantmod@358-getsymbols-new.session

✔  checking for file ‘/tmp/RtmpI0Q3cp/remotes1ebcff64cdb8cc/joshuaulrich-quantmod-0a90c3a/DESCRIPTION’ ...
─  preparing ‘quantmod’:
✔  checking DESCRIPTION meta-information ...
─  installing the package to process help pages
         -----------------------------------
─  installing *source* package ‘quantmod’ ...
   ** using staged installation
   ** R
   ** demo
   ** byte-compile and prepare package for lazy loading
   Error: package ‘xts’ 0.12.1 was found, but > 0.12.1 is required by ‘quantmod’
   Execution halted
   ERROR: lazy loading failed for package ‘quantmod’
─  removing ‘/tmp/Rtmp1v5YAX/Rinst1ebdff5823613b/quantmod’
         -----------------------------------
   ERROR: package installation failed
Error: Failed to install 'quantmod' from GitHub:
  System command 'R' failed, exit status: 1, stdout & stderr were printed
Execution halted
edd@rob:~$ 
joshuaulrich commented 2 years ago

Ugh, I made the commit but didn't push. Thanks @eddelbuettel.

awp-finanznachrichten commented 2 years ago

Hello,

Since we are also working with your package, we are very happy about the quick fixing of the bug, thank you!

eddelbuettel commented 2 years ago

@awp-finanznachrichten Please review and then edit your post. Step 1 is now no longer needed. You were too fast.

abernal30 commented 2 years ago

@joshuaulrich It works pretty fine now, thank so much for your time and effort!!!

pyrfin commented 2 years ago

@joshuaulrich It works now. Thanks for your support!

OmegaSquared commented 2 years ago

Following worked for me:

remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session")

Thank you @joshuaulrich for having a solution so quickly. This is why I love your work, when something breaks you are on top of it. Cheers mate.

shumakerro commented 2 years ago

Thanks Josh, got it working and I'll echo all the compliments for your work now and always.

cynthianahartono commented 2 years ago

Does using remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session") mean the getSymbol function cannot be used?

Been trying to use it but got this error "could not find function "getSymbols""

samiranvekar commented 2 years ago

post executing remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session") with option None

and then typing library(quantmod) I get the following error

Loading required package: xts Loading required package: zoo

Attaching package: ‘zoo’

The following objects are masked from ‘package:base’:

as.Date, as.Date.numeric

Loading required package: TTR Error in value[3L] : Package ‘quantmod’ version 0.4.18 cannot be unloaded: Error in unloadNamespace(package) : namespace ‘quantmod’ is imported by ‘FinancialInstrument’, ‘quantstrat’, ‘blotter’ so cannot be unloaded In addition: Warning messages: 1: package ‘xts’ was built under R version 4.0.5 2: package ‘TTR’ was built under R version 4.0.5

Hence I am not able to use getSymbol function

How to resolve this?

TH3Heurist commented 2 years ago

@joshuaulrich You are a legend! Thank you sir.

localperf commented 2 years ago

remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session")

works for me! Thanks!

MiraiLi00 commented 2 years ago

Now it is working for me too! Thank you very much to @joshuaulrich for resolving the issue and also to all of you for your useful comments!!

msperlin commented 2 years ago

Same here (linux mint 20.3). Thanks!

joshuaulrich commented 2 years ago

Does using remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session") mean the getSymbol function cannot be used?

Been trying to use it but got this error "could not find function "getSymbols""

@cynthianahartono looks like you need to run library("quantmod"). You need that command before you can use getSymbols().

joshuaulrich commented 2 years ago

Package ‘quantmod’ version 0.4.18 cannot be unloaded: Error in unloadNamespace(package) : namespace ‘quantmod’ is imported by ‘FinancialInstrument’, ‘quantstrat’, ‘blotter’ so cannot be unloaded

@samiranvekar You probably need to restart R and then install the new quantmod before you load those other packages that depend on it.

samiranvekar commented 2 years ago

Thanks@joshuaulrich. I will try the suggestion

However when the permanent fix will be delivered for quantmod package in CRAN

SamirA

cynthianahartono commented 2 years ago

Does using remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session") mean the getSymbol function cannot be used? Been trying to use it but got this error "could not find function "getSymbols""

@cynthianahartono looks like you need to run library("quantmod"). You need that command before you can use getSymbols().

@joshuaulrich works like a charm, thank you!!

pkinif commented 2 years ago

Thanks for fixing this issue so quickly @joshuaulrich

BathosEconTrade commented 2 years ago

Man, had no idea how dependent I had become on Quandl. Thank you for your help and look forward to the CRAN fix. Any idea when?

joshuaulrich commented 2 years ago

@samiranvekar and @BathosEconTrade, I hope to have it on CRAN later today. I'm still working through some reverse dependency checks. Keep in mind that it usually takes CRAN a day or two to build the Windows binaries, so you will get a message about there not being a new version on CRAN until that happens if you're on Windows.

yw6010 commented 2 years ago

Hi joshuaulrich, I got the same warning message when I call the tq_get() command. Is it due to the same issue? How should I fix this problem quickly? Should I use the same code provided above? Very appreciate!

zlfang00 commented 2 years ago

@joshuaulrich Got errors when trying to install it to a local lib path. The error says :ERROR: dependencies ‘xts’, ‘TTR’ are not available for package ‘quantmod’, but strangely they seems installed successfully and it does not complain about zoo is required the same way

> libpath = "/opt/zfang/R/lib/"
> remotes::install_github("joshuaulrich/quantmod@358-getsymbols-new.session",lib=libpath)
Downloading GitHub repo joshuaulrich/quantmod@358-getsymbols-new.session
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                         
2: CRAN packages only          
3: None                        
4: zoo (1.8-9 -> 1.8-10) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1
zoo (1.8-9 -> 1.8-10) [CRAN]
xts (NA    -> 0.12.1) [CRAN]
TTR (NA    -> 0.24.3) [CRAN]
Installing 3 packages: zoo, xts, TTR
trying URL 'https://cran.rstudio.com/src/contrib/zoo_1.8-10.tar.gz'
Content type 'application/x-gzip' length 808943 bytes (789 KB)
==================================================
downloaded 789 KB

trying URL 'https://cran.rstudio.com/src/contrib/xts_0.12.1.tar.gz'
Content type 'application/x-gzip' length 517875 bytes (505 KB)
==================================================
downloaded 505 KB

trying URL 'https://cran.rstudio.com/src/contrib/TTR_0.24.3.tar.gz'
Content type 'application/x-gzip' length 317338 bytes (309 KB)
==================================================
downloaded 309 KB

* installing *source* package ‘zoo’ ...
** package ‘zoo’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include  -I/usr/local/include  -fpic  -g -O2  -c coredata.c -o coredata.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include  -I/usr/local/include  -fpic  -g -O2  -c init.c -o init.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include  -I/usr/local/include  -fpic  -g -O2  -c lag.c -o lag.o
gcc -shared -L/opt/R360/lib64/R/lib -L/usr/local/lib64 -o zoo.so coredata.o init.o lag.o -L/opt/R360/lib64/R/lib -lR
installing to /opt/zfang/R/lib/00LOCK-zoo/00new/zoo/libs
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (zoo)
* installing *source* package ‘xts’ ...
** package ‘xts’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c add_class.c -o add_class.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c any.c -o any.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c attr.c -o attr.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c binsearch.c -o binsearch.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c coredata.c -o coredata.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c diff.c -o diff.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c dimnames.c -o dimnames.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c endpoints.c -o endpoints.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c extract_col.c -o extract_col.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c init.c -o init.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c isOrdered.c -o isOrdered.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c isXts.c -o isXts.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c merge.c -o merge.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c na.c -o na.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c period_apply.c -o period_apply.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c period_arithmetic.c -o period_arithmetic.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c period_quantile.c -o period_quantile.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c rbind.c -o rbind.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c rollfun.c -o rollfun.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c runSum.c -o runSum.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c startofyear.c -o startofyear.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c subset.c -o subset.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c subset.old.c -o subset.old.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c toperiod.c -o toperiod.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c totalcols.c -o totalcols.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c tryXts.c -o tryXts.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG -I../inst/include -I"/opt/zfang/R/lib/zoo/include" -I/usr/local/include  -fpic  -g -O2  -c unique.time.c -o unique.time.o
gcc -shared -L/opt/R360/lib64/R/lib -L/usr/local/lib64 -o xts.so add_class.o any.o attr.o binsearch.o coredata.o diff.o dimnames.o endpoints.o extract_col.o init.o isOrdered.o isXts.o merge.o na.o period_apply.o period_arithmetic.o period_quantile.o rbind.o rollfun.o runSum.o startofyear.o subset.o subset.old.o toperiod.o totalcols.o tryXts.o unique.time.o -L/opt/R360/lib64/R/lib -lR
installing to /opt/zfang/R/lib/00LOCK-xts/00new/xts/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (xts)
* installing *source* package ‘TTR’ ...
** package ‘TTR’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG  -I"/opt/zfang/R/lib/xts/include" -I/usr/local/include  -fpic  -g -O2  -c adjRatios.c -o adjRatios.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG  -I"/opt/zfang/R/lib/xts/include" -I/usr/local/include  -fpic  -g -O2  -c aroon.c -o aroon.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG  -I"/opt/zfang/R/lib/xts/include" -I/usr/local/include  -fpic  -g -O2  -c init.c -o init.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG  -I"/opt/zfang/R/lib/xts/include" -I/usr/local/include  -fpic  -g -O2  -c moving_averages.c -o moving_averages.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG  -I"/opt/zfang/R/lib/xts/include" -I/usr/local/include  -fpic  -g -O2  -c percent_rank.c -o percent_rank.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG  -I"/opt/zfang/R/lib/xts/include" -I/usr/local/include  -fpic  -g -O2  -c runfun.c -o runfun.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG  -I"/opt/zfang/R/lib/xts/include" -I/usr/local/include  -fpic  -g -O2  -c sar.c -o sar.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG  -I"/opt/zfang/R/lib/xts/include" -I/usr/local/include  -fpic  -g -O2  -c wilderSum.c -o wilderSum.o
gcc -I"/opt/R360/lib64/R/include" -DNDEBUG  -I"/opt/zfang/R/lib/xts/include" -I/usr/local/include  -fpic  -g -O2  -c zigzag.c -o zigzag.o
gcc -shared -L/opt/R360/lib64/R/lib -L/usr/local/lib64 -o TTR.so adjRatios.o aroon.o init.o moving_averages.o percent_rank.o runfun.o sar.o wilderSum.o zigzag.o -L/opt/R360/lib64/R/lib -lR
installing to /opt/zfang/R/lib/00LOCK-TTR/00new/TTR/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (TTR)

The downloaded source packages are in
    ‘/tmp/RtmpbB9zsn/downloaded_packages’
✓  checking for file ‘/tmp/RtmpbB9zsn/remotes4d43677dd4d4/joshuaulrich-quantmod-7fc8ef2/DESCRIPTION’ ...
─  preparing ‘quantmod’:
✓  checking DESCRIPTION meta-information ...
─  installing the package to process help pages
         -----------------------------------
   ERROR: dependencies ‘xts’, ‘TTR’ are not available for package ‘quantmod’
─  removing ‘/tmp/RtmpJP1VFa/Rinst50622bb4a0e0/quantmod’
         -----------------------------------
   ERROR: package installation failed
Error: Failed to install 'quantmod' from GitHub:
  System command 'R' failed, exit status: 1, stdout + stderr:
E> * checking for file ‘/tmp/RtmpbB9zsn/remotes4d43677dd4d4/joshuaulrich-quantmod-7fc8ef2/DESCRIPTION’ ... OK
E> * preparing ‘quantmod’:
E> * checking DESCRIPTION meta-information ... OK
E> * installing the package to process help pages
E>       -----------------------------------
E> ERROR: dependencies ‘xts’, ‘TTR’ are not available for package ‘quantmod’
E> * removing ‘/tmp/RtmpJP1VFa/Rinst50622bb4a0e0/quantmod’
E>       -----------------------------------
E> ERROR: package installation failed
joshuaulrich commented 2 years ago

I got the same warning message when I call the tq_get() command. Is it due to the same issue? How should I fix this problem quickly? Should I use the same code provided above?

@yw6010 yes, same issue because tq_get() uses quantmod. Use the same call to remotes::install_github() provided previously.

yw6010 commented 2 years ago

I got the same warning message when I call the tq_get() command. Is it due to the same issue? How should I fix this problem quickly? Should I use the same code provided above?

@yw6010 yes, same issue because tq_get() uses quantmod. Use the same call to remotes::install_github() provided previously.

I might be wrong, but I think tq_get() is under tidyquant package, like tq_get("DOGE-USD", from = start_date, to = until_date, get = "stock.prices") Also, I receieved another warning after I run the remotes::install_github() which is 'package ‘quantmod’ is in use and will not be installed'. Thanks for your help