tq_index error, its creating an excel file? - r

For some reason, I im getting this error when I run:
DOW = tq_index("DOW")
and the error:
Getting holdings for DOW
Error at DOW during download.
Error: Evaluation error: zip file 'C:\Users\mbhe\AppData\Local\Temp\RtmpA59N1Y\file1bf4feb669b.xlsx' cannot be opened.
This excel file is different every time, so if I run it again, I will get the same error, but a new excel will be created and reported in the error.
This is the first time my R Studio have done this.
Does any of you guys know how to fix this? When i look around the internet, this error only occurs when you actually try to load a excel file, not when you want to get info from tq_index.

This seems like an issue with tidyquant package.
You can try DOW = quantmod::getQuote("^DJI")

Related

Error message in Ferret related to a netcdf file

I am actually trying to open a netcdf file with 'Ferret' and I get this error message.
In sum up, when trying to open the file:
use all_sondes_test.nc
I get the following message:
NetCDF: Not a valid data type or _FillValue type mismatch (OPeNDAP/netCDF Error code -45) is this a CDF file ?
I hope the problem looks clear to the community.
I have already tried to find some help on the web, without any success.
Thanks for your help !

Does anyone know what this error message (from the 'readxl' package in R) means?

I'm trying to open an Excel worksheet in R using the 'readxl' package function 'read_excel'.
library(readxl)
Test <- read_excel("Test.xlsx",sheet = "Sheet1")
I've used the exact same bit of code on the exact same excel workbook many times over the past year, and it has never caused a problem. This time, though, I get:
Error: object ‘data_frame’ is not exported by 'namespace:vctrs'
I've tried calling the file different things, moving it to different locations, opening different files etc. but am now always getting this error with the read_excel function. I can usually work out what to do in response to an error message by searching for the relevant string in Google. However, I've tried searching for this error message, and haven't found anything that looks helpful yet. If anyone has any ideas, these would be much appreciated!
It looks like data_frame is relatively new to vctrs. You may need to update your vctrs package. You may have accidentally rolled back to an earlier version?
Seems it was added here:
vctrs 0.3.3 2020-08-27

Text mining with tm in R antiword error

So I'm rather new to R, and I'm learning how to mine text from this handy website: https://eight2late.wordpress.com/2015/05/27/a-gentle-introduction-to-text-mining-using-r/
I do have my own text set of .doc, .docx, and .xlsx files and I'm trying to mine them. They're located in a folder in my working directory called 'files', but I have already encountered an error after simply writing a few lines of code.
The code I have so far is:
library(tm)
library(readtext)
data = readtext('files')
At this point, after waiting for 25 seconds or so, I get the error:
Error: System call to 'antiword' failed (1): The Big Block Depot is damaged
and the code stops running there.
I have tried searching online for solutions but it seems like a fairly rare error and so I only found 1 possible solution at https://github.com/ropensci/antiword/issues/1 but that did not work for me.
This solution suggested that one of my files were corrupt, and suggested using the code
fixInNamespace(antiword, pos="package:antiword")
to change the error to a warning to not interrupt the reading of the files. I tried that, and at first it raised the error of
Error in as.environment(pos):
no item called "package:antiword" on the search list
After which, I loaded the antiword library with a library(antiword) and changed the stop( to a warning(. However, when I ran the data = readtext('files') line again, it immediately raised the error
Error in is_windows() : could not find function "is_windows"
I'm at a loss here! Any help would be appreciated. Should I be using another package in this case?
I had the same problem with my code, where I tried to get a doc. file in R. I also used the readtext library. What helped me was converting the Word documents I was trying to get into R from doc. to docx. When I ran the same code after it worked.

How to solve this error message in rmarkdown?

I am just starting to explore the rmarkdown package. I don't use Rstudio. I use the default R environment. What I did was as follows.
I created a new R document.
Started typing few lines in rmarkdown format.
Saved the file with Rmd extension.
I saved the file in the working directory.
I installed the pandoc using the pkg file.
I installed 'rmarkdown' package. Loaded the package.
Used the following command to render the Rmd file.
rmarkdown::render("Untitled.Rmd")
I get the following error.
Error in tools::file_path_as_absolute(input) : file 'Untitled.Rmd'
does not exist
I tried all the possible ways such as giving the exact path instead of filename etc. But nothing worked out. I googled the error message and found that none had similar error. Can someone help me with this. What I am missing. What the error message mean?
Most of the time the error file not found is either a type error or a real missing file (as in your case, the real one is named in another way).
In order to discard those possibilities:
Copy the fullpath from your filebrowser.
Make sure the file exists, inside R you could type:
file.exists("/fullpath/to/file")
If that return TRUE and the error persists, then you suspect another thing is going on.

Slow or stacking file.choose() in R

If I have more data loaded in R I'm having difficulties with opening and choosing new file via file.choose() and later upload via read.csv(), but I would not get to that point since the file.choose function stacks and the R "crushes" and reports something like "unidentified error occurred and that the R must restart".
I'm using RStudio and running this on Windows 7. The hardware is up to date.
Could someone point me on why this is happing and what would be a remedy against this. Are there other options to select file? I know I can insert the path right into the read.csv command, but the (file is different every time).
EDIT:
The error just happened again. I can not reproduce the error so it happens rather only with high likelihood if the conditions for it are met.
The error reads as: R Session Aborted.R encountered fatal error. The session was terminated. And in window: "Start New Session".
EDIT 2:
I would just rephrase my question. The question is whether there is other option like command or package that deals with choosing a file. [file.choose()]
The error can not be reproduced and hence I can not expect someone gives reasonable comment on this. But if this occurred someone in the past and solved it, I would like to hear about it. Thanks.
EDIT 3: Further to the error. I have spotted just now sentence in red in Console: Error: Unable to provide connection with R

Resources