knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
library(covr) package_coverage() file.rename("R/addition.R", "R/addition.R.bak") package_coverage() file.rename("R/addition.R.bak", "R/addition.R")
library(knitr) library(webshot) cov <- code_coverage( 'curry2 <- function(x) { if(is.data.frame(x)) return(1) else # test return(0) }', 'curry2("a")') webshot(report(cov, browse = FALSE), selector = c("#files"), eval = "casper.then(function() { this.click('td a')});") percent_coverage(cov) as.data.frame(cov)
cov <- code_coverage( 'curry <- function(x) { if(is.data.frame(x)){ # test0 return(1) } else if (is.character(x)){ # test return(0) } else if (is.numeric(x)){ # test1 return(2) } else{ return(3) } }', 'curry("a")') webshot(report(cov, browse = FALSE), selector = c("#files"), eval = "casper.then(function() { this.click('td a')});") percent_coverage(cov) as.data.frame(cov)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.