Comments (1)
Yes, for now it doesn't cover other disclosures. But, it is possible to get the data from parsed XBRL directly. In the result returned by xbrlDoAll there are tables:
- element (=XBRL concepts)
- context (=periods, dimensions)
- fact (=values)
We have to find concepts related to warrants and join them to context and value:
library(XBRL)
report_url <- "https://www.sec.gov/Archives/edgar/data/320193/000119312514383437/aapl-20140927.xml"
old_o <- options(stringsAsFactors = FALSE)
xbrl_data <- xbrlDoAll(report_url)
options(old_o)
library(dplyr)
library(tidyr)
xbrl_data$element %>%
filter(grepl("Warrant",elementId) & # all "Warrant" elements
type == "xbrli:monetaryItemType") %>%
inner_join(xbrl_data$fact, by = "elementId") %>%
inner_join(xbrl_data$context, by = "contextId") %>%
dplyr::mutate(amount = as.numeric(fact)*10^(as.numeric(decimals))) %>%
select(elementId, amount, startDate, endDate, periodType) %>%
split(.$periodType)
# Result:
# $duration
# elementId amount startDate endDate periodType
# 1 StandardProductWarrantyAccrualPayments 3703 2012-09-30 2013-09-28 duration
# 2 StandardProductWarrantyAccrualPayments 3760 2013-09-29 2014-09-27 duration
# 3 StandardProductWarrantyAccrualPayments 1786 2011-09-25 2012-09-29 duration
# 4 StandardProductWarrantyAccrualWarrantiesIssued 5032 2012-09-30 2013-09-28 duration
# 5 StandardProductWarrantyAccrualWarrantiesIssued 4952 2013-09-29 2014-09-27 duration
# 6 StandardProductWarrantyAccrualWarrantiesIssued 2184 2011-09-25 2012-09-29 duration
#
# $instant
# elementId amount startDate endDate periodType
# 7 StandardProductWarrantyAccrual 1240 <NA> 2011-09-24 instant
# 8 StandardProductWarrantyAccrual 1638 <NA> 2012-09-29 instant
# 9 StandardProductWarrantyAccrual 2967 <NA> 2013-09-28 instant
# 10 StandardProductWarrantyAccrual 4159 <NA> 2014-09-27 instant
from finstr.
Related Issues (15)
- error: cannot join on columns 'elementId' x 'elementId': HOT 5
- Error in if (substr(file.name, 1, 5) != "http:") {: argument is of length zero Traceback: HOT 2
- merge.statement does not working
- Error in download file HOT 8
- Correct the Spread command in xbrl_get_data( )
- Doesn't work on xml files after 2016
- xbrl_get_statements skips Consolidated Statements of Operations
- Warning message: In xbrl_get_data(elements, xbrl_vars) : Rows with duplicated endDate HOT 2
- Installing finstr HOT 6
- Unable to create statements from XBRL documents
- Outstanding shares from 10k or 10q HOT 7
- Error re: Non-numeric variable in data frame: date
- Is there a parameter which mentions in what denomination the figures are?
- How can I change Taxonomy?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from finstr.