How to take the lists created by xbrlDoAll in the XBRL package in R and arrange them in dataframes readable in Excel?

I experimented with the XBRL package in R to try to write a function that would loop through companies and display financial reports, ideally in a very standard data frame. But I do not understand the way out. Using the function, and then looking at the data frame, all that is displayed is the total in the leftmost column, with the right-side URL of the various XML / XBRL / C ++ components on the right. I admit that I have very little XBRL knowledge, but I have to miss something. How to use the functions of this package to cycle through and register all XBRL statements, formatting into something that can be used for the end user?

Using the example from the pdf manual is easy, but it prints weirdly, and I have no idea how to do this in the correct data frame:

## Setting stringsAsFactors = FALSE is highly recommended
## to avoid data frames to create factors from character vectors.
options(stringsAsFactors = FALSE)
## Load the library
library(XBRL)
## XBRL instance file to be analyzed, accessed
## directly from SEC website:
inst <- "http://www.sec.gov/Archives/edgar/data/21344/000002134413000050/ko-20130927.xml"
## Level 1: Function that does all work and returns
## a list of data frames with extracted information:
## Not run:
xbrl.vars <- xbrlDoAll(inst, verbose=TRUE)

A summary of this gives a bunch of lists of different line lengths:

summary (xbrl.vars) Length class mode element 7 data.frame list role 5 data.frame list calculation 11 data.frame list context 13 data.frame list block 4. data list. fax list 7 facts footnote 5 data.frame list definition 11 data.frame list label 5 data.frame list view 11 data.frame list

, data.frame ( ? data.frames?) R. , ( ). : data.frame R. :   xbrl.vars2 < -as.data.frame(as.matrix(xbrl.vars)) , , R , ? , R .

.

+1
1

xbrlDoAll - . , , .

(, , , , ..) XBRL. , .

XBRL- XML, XLinks data.frames , - , dplyr tidyr. . R github.

0

All Articles