Skip to contents

Pointing knitr to this function alows you to run SPARQL chunks from R Markdown: knitr::knit_engines$set(sparql = SPARQLchunks::eng_sparql). Usage is internal.

Usage

eng_sparql(opts)

Arguments

opts

Chunk options, as provided by knitr during chunk execution. Chunk option for this is sparql. Note that we avoid calling this "options" to avoid conflict with an R system function name.

Value

Data in dataframe or list form (depending on opts). The function only returns when no output.var to store its result into is defined.

Details

The sparql engine can be activated via

knitr::knit_engines$set(sparql = SPARQLchunks::eng_sparql)

This will be set within an R Markdown document's setup chunk. Do not use eng_sparql function elsewhere.

References

André Ourednik (2021). Execute SPARQL chunks in Rmarkdown Available at: https://ourednik.info/maps/2021/12/14/execute-sparql-chunks-in-r-markdown/

Examples

library(SPARQLchunks)
knitr::knit_engines$set(sparql = SPARQLchunks::eng_sparql)