options(knitr.duplicate.label = "allow")
knitr::opts_chunk$set(echo = TRUE, include= TRUE, message = TRUE)

Parent start

Before calling child:

paramNames <- c("child", "parent", "grand",
                "grandNchild", "grandNparent", "parentNchild", "all" )
opts <- sapply( paramNames, function( opt ) {
    ifelse(is.null(params[[ opt ]]), "", params[[ opt ]])
})
data.frame( Param= opts,
            WantDirect= c("", "parent", "", "", "parent", "parent", "parent" ),
            WantFromGrand= c("", "parent", "grand", "grand", "grand", "parent", "grand" )
)

Calling child:

ComplexRmd::includeChild( "paramChild.Rmd" )

After calling child, back to parent starting parameters:

paramNames <- c("child", "parent", "grand",
                "grandNchild", "grandNparent", "parentNchild", "all" )
opts <- sapply( paramNames, function( opt ) {
    ifelse(is.null(params[[ opt ]]), "", params[[ opt ]])
})
data.frame( Param= opts,
            WantDirect= c("", "parent", "", "", "parent", "parent", "parent" ),
            WantFromGrand= c("", "parent", "grand", "grand", "grand", "parent", "grand" )
)

Parent end



JefferysAnalysis/ComplexRmd documentation built on Dec. 18, 2021, 12:35 a.m.