0

Ran following: library(finstr) inst<- "http://edgar.sec.gov/Archives/edgar/data/320193/000119312514383437/aapl-20140927.xml"

xbrl.vars<- xbrlDoAll(inst, verbose=TRUE)

st2013<-xbrl_get_statements(xbrl.vars)

Recevied following error

Error: cannot join on columns 'elementId' x 'elementId': Can't join on 'elementId' x 'elementId' because of incompatible types (factor / integer) In addition: Warning message: In semi_join_impl(x, y, by$x, by$y) : joining factors with different levels, coercing to character vector

4

1 回答 1

0

达科·贝甘特的回答

现在在调用 xbrDoAll 之前使用 options(stringsAsFactors = FALSE)。建议在 XBRL 包中使用(参见 ?xbrlDoAll),因此 finstr::xbrl_get_statements 期望数据帧没有因素。

例子:

图书馆(finstr)inst<-“ http://edgar.sec.gov/Archives/edgar/data/320193/000119312514383437/aapl-20140927.xml

old_o <- options(stringsAsFactors = FALSE) xbrl.vars<- xbrlDoAll(inst, verbose=TRUE) options(old_o)

st2013<-xbrl_get_statements(xbrl.vars)

于 2015-07-15T19:07:24.880 回答