options(knitr.duplicate.label = "allow") knitr::opts_chunk$set(echo = TRUE, include= TRUE, message = TRUE)
child <- "child" grandNchild <- "child" parentNchild <- "child" all <- "child" varNames <- c("child", "parent", "grand", "grandNchild", "grandNparent", "parentNchild", "all" ) vars <- sapply( varNames, function( var ) { ifelse( exists( var), get(var), "") }) data.frame( Variable= vars, WantDirect= c("child", "", "", "child", "", "child", "child" ), WantParent= c("child", "parent", "", "child", "parent", "child", "child" ), WantGrand= c("child", "parent", "grand", "child", "parent", "child", "child" ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.