Skip to content

Commit

Permalink
use knitr:::opts_chunk_attr when available
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Mar 26, 2012
1 parent e0884e2 commit f429648
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cpp/session/modules/SessionAuthoring.R
Expand Up @@ -13,6 +13,11 @@

.rs.addFunction( "knitrChunkOptions", function()
{
# starting with v0.4.2 this is avavilable directly from knitr
if (packageVersion("knitr") >= "0.4.2")
return(knitr:::opts_chunk_attr)

# still try to return correct results for previous versions
knitrOptions <- knitr:::opts_chunk$get()
knitrOptions <- as.list(sapply(knitrOptions, class))
knitrOptions[knitrOptions == "NULL"] <- "character"
Expand Down

0 comments on commit f429648

Please sign in to comment.