I am suddenly getting an error messaging when using tigris::counties() even though the same code worked perfectly fine a few weeks ago. Can anyone replicate this error or know of a workaround?
require(tigris)
counties_VT <- counties(state="VT",cb=T,class="sf")
Error Message:
Retrieving data for the year 2020
Error: Cannot open "C:\Users\QSMITH\AppData\Local\Temp\RtmpYZZH4z"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
In addition: Warning message:
In unzip(file_loc, exdir = tmp) : error 1 in extracting from zip file
Thank you!
Related
I am reading 2 vcf files in to R. They load fine (I have used 3 different methods to do this (read.vcf, readVCF, and fread) and all are fine) however when I go on to try and do anything with 1 of the vcf files, the msg reads:
Error in unlist_as_integer(x#subscript) : object 'fancy_mseq' not found
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 'from': object 'fancy_mseq' not found
Usually I just google error msgs but I can not find anything online about this. Does anyone have any idea what could be causing this error message? Whilst it's hard to be 100% sure because of the vcf format, I can't see anything wrong with the file when I call str(), head() or any other ways of looking at the data.
Thank you!
I am trying to download the XBRL data from the SEC site, using the finstr package in R.
The vignette references Apple financial statements from 2013-14. I am going after Abbott (CIK 1800) for mine. I've looked through the data records on the SEC site and the submission is in this folder:
https://www.sec.gov/Archives/edgar/data/1800/000110465920023904
The Apple xml file is named aapl-20140927.xml (the CIK followed by the submission date). I've gone into the file through a browser and identified the relevant data.
The Abbott xml file that has the same info is named abt-20191231x10k59d41b_htm.xml , again with the relevant data.
Following the vignette, I've added this code:
xbrl_url2020 <- "https://www.sec.gov/Archives/edgar/data/1800/000110465920023904/abt-20191231x10k59d41b_htm.xml"
xbrl_url2019 <-
"https://www.sec.gov/Archives/edgar/data/1800/000104746919000624/abt-20181231.xml"
old_o <- options(stringsAsFactors = FALSE)
xbrl_data_aapl2020 <- xbrlDoAll(xbrl_url2020)
This then returns:
Error in fileFromCache(file) :
Error in download.file(file, cached.file, quiet = !verbose) :
cannot open URL 'https://www.sec.gov/Archives/edgar/data/1800/000110465920023904/https://xbrl.sec.gov/dei/2019/dei-2019-01-31.xsd'
In addition: Warning message:
In download.file(file, cached.file, quiet = !verbose) :
cannot open URL 'https://www.sec.gov/Archives/edgar/data/1800/000110465920023904/https://xbrl.sec.gov/dei/2019/dei-2019-01-31.xsd': HTTP status was '404 Not Found'
I've read through other submissions here and not sure whether it's a schema issue, whether I've gone after the wrong file (there's no other in the folder which has the info in totality) or whether it's something else.
Also I've noticed a comment saying the datasets on the SEC site https://www.sec.gov/dera/data/financial-statement-data-sets.html have all the relevant info. The issue with the sets is that they are the submitted data and not the ratified so may be different to the final results published.
Appreciate any help possible.
I am downloading a file from Azure to a connection. The download appears to go through but unserializing gives an error. Any ideas what may be going wrong or how to go about debugging?
con <- rawConnection(raw(0), "r+")
storage_download(AzureContainer, src="sourcefile.fst", dest=con)
unserialize(con)
Error in unserialize(con) : unknown input format
I'm trying to download financial statements in R using a package at:
Financial statements in R
I'm trying to modify the example in their read me for other companies. I have tried to download the last two Tesla Q's.
The code I modified so far is:
xbrl_url2017Q3 <- "https://www.sec.gov/Archives/edgar/data/1318605/000156459018026353/tsla-20180930.xml"
xbrl_url2017Q2 <- "https://www.sec.gov/Archives/edgar/data/1318605/000156459018019254/tsla-20180630.xml"
old_o <- options(stringsAsFactors = FALSE)
xbrl_data_tsla2017Q3 <- xbrlDoAll(xbrl_url2017Q3)
Error from the line above is:
Error in fileFromCache(file) :
Error in download.file(file, cached.file, quiet = !verbose) :
cannot open URL 'https://www.sec.gov/Archives/edgar/data/1318605/000156459018026353/https://xbrl.sec.gov/dei/2018/dei-2018-01-31.xsd'
In addition: Warning message:
In download.file(file, cached.file, quiet = !verbose) :
cannot open URL 'https://www.sec.gov/Archives/edgar/data/1318605/000156459018026353/https://xbrl.sec.gov/dei/2018/dei-2018-01-31.xsd': HTTP status was '403 Forbidden'
xbrl_data_tsla2017Q2 <- xbrlDoAll(xbrl_url2017Q2)
options(old_o)
tsla2017Q3 <- xbrl_get_statements(xbrl_data_tsla2017Q3)
tsla2017Q2 <- xbrl_get_statements(xbrl_data_tsla2017Q2 )
tsla2017Q2
balance_sheet2017Q2 <- tsla2017Q2$StatementOfFinancialPositionClassified
balance_sheet2017Q3<- tsla2017Q3$StatementOfFinancialPositionClassified
income2017Q2 <- tsla2017Q2$StatementOfIncome
income2017Q3 <- tsla2017Q3$StatementOfIncome
balance_sheet2017Q3
Returns "NULL"
See the 10-Q at tesla's SEC fillings.
The last 10-Q.
Any recommendations on how I can go about this?
I'm looking to download the financial data to play around it with and would like it in tidy formate.
This is a common problem with the XBRL package where not all XML schemas are downloaded in the cache for some SEC filings. Download the missing schema in your cache folder and retry the xbrlDoAll call - it should work this time.
I'm trying to get data from 2000 and 2010:
acs.fetch(endyear="2000",span="0", LA_tract, variable="H002_001", dataset="sf1")
Also tried:
acs.fetch(endyear="2000",span="0", LA_tract, table.name="H002", dataset="sf1")
(LA_tract is the geography)
I get an error:
Error in file(file, "rt") : cannot open the connection
The variable/table number is correct...
The function and key work fine with ACS data - just not decade data.
I would appreciate any help with this issue.
span is the number of years in the survey. I've seen 5 and 3 and 1, but not 0.