## Not run:
# ## Setting stringsAsFactors = FALSE is highly recommended
# ## to avoid data frames to create factors from character vectors.
# options(stringsAsFactors = FALSE)
#
# ## XBRL instance file to be analyzed.
# ## NOTE: in this case, inst needs to be a local file, or accessible
# ## as http (not https).
# inst <- "ko-20130927.xml"
# ## Parse the instance (doc is an pointer to
# ## external memory that needs to be freed after use):
# doc <- xbrlParse(inst)
# ## Get a data frame with facts:
# fct <- xbrlProcessFacts(doc)
# ## Get a data frame with contexts:
# cts <- xbrlProcessContexts(doc)
# ## Get a data frame with units:
# unt <- xbrlProcessUnits(doc)
# sch <- xbrlGetSchemaName(doc)
# ## Free the external memory used:
# xbrlFree(doc)
#
# dname <- dirname(inst)
# ## Parse the schema file:
# docS <- xbrlParse(paste0(dname,"/",sch))
# ## Get roles:
# rls <- xbrlProcessRoles(docS)
# head(rls)
# ## Free the external memory used:
# xbrlFree(docS)
# ## End(Not run)
Run the code above in your browser using DataLab