options("width"=101)
tmp <- devtools:::read_dcf("DESCRIPTION")
cat("#", tmp$Title)



Status

library(knitr)
doc_type <- opts_knit$get("rmarkdown.pandoc.to")
if( !is.null(doc_type) && doc_type=="html" ){
cat(
'
[![Travis-CI Build Status](https://travis-ci.org/petermeissner/diffrprojectswidget.svg?branch=master)](https://travis-ci.org/petermeissner/diffrprojectswidget)
[![codecov](https://codecov.io/gh/petermeissner/diffrprojectswidget/branch/master/graph/badge.svg)](https://codecov.io/gh/petermeissner/diffrprojectswidget/tree/master/R)
[![CRAN version](http://www.r-pkg.org/badges/version/diffrprojectswidget)](https://cran.r-project.org/package=diffrprojectswidget)
'
)
}
filelist.R   <- list.files("R", recursive = TRUE, pattern="\\.R$", ignore.case = TRUE, full.names = TRUE)
filelist.tests   <- list.files("tests", recursive = TRUE, pattern="\\.R$", ignore.case = TRUE, full.names = TRUE)
filelist.cpp <- list.files("src", recursive = TRUE, pattern="\\.cpp$", ignore.case = TRUE, full.names = TRUE)
lines.R      <- unlist(lapply(filelist.R, readLines))
lines.tests  <- unlist(lapply(filelist.tests, readLines))
lines.cpp    <- unlist(lapply(filelist.cpp, readLines))
length.R     <- 
  length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.R,  value = TRUE, invert = TRUE))
length.tests <- 
  length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.tests,  value = TRUE, invert = TRUE))
length.cpp   <- 
  length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.cpp,  value = TRUE, invert = TRUE))

R code: r length.R
C++ code: r length.cpp
test code: r length.tests



Version

cat(tmp$Version)



Description

cat(tmp$Description)



Funding

This software was created as part of the "Institutional Design in Western European Democracies" research project, funded by DFG (Deutsche Forschungsgemeinschaft), lead by Ulrich Sieberer and based at University Konstanz.



License

cat(tmp$License, "<br>")
cat(as.character(eval(parse(text=tmp$Author))))



Citation

citation("diffrprojectswidget")



BibTex for citing

toBibtex(citation("diffrprojectswidget"))



Installation

devtools::install_github("petermeissner/stringb")
devtools::install_github("petermeissner/rtext")
devtools::install_github("petermeissner/diffrprojects")
devtools::install_github("petermeissner/diffrprojectswidget")

... or, alternatively from my private R package repository ...

options( "repos" = 
  c(
    options("repos")$repos, 
    petermeissner="https://petermeissner.github.io/drat"
  ) 
)
install.packages("diffrprojectswidget")



Example usage

library(diffrprojectswidget)

dp <-
  diffrproject$new()$
  text_add(list(text_version_1, text_version_2))$
  text_link()$
  text_align( maxDist = 1 )

dp$text_code_regex(
  text    = 1, 
  x       = "change",    
  pattern = "change", 
  val     = "change"
)
dp$text_code_regex(
  text    = 1, 
  x       = "change",    
  pattern = "add", 
  val     = "add"
)
dp$text_code_regex(
  text    = 1, 
  x       = "change",    
  pattern = "modif", 
  val     = "modif"
)
dp$text_code_regex(
  text    = 1, 
  x       = "change",    
  pattern = "delete", 
  val     = "delete"
)
dp$text_code_regex(text=1, x="stability", pattern="same", val=TRUE)

dp$alignment_code(1, sample(1:6)*2,"alignment_code", TRUE)
dpv <- dp_vis(dp, 1, align_var = TRUE, text_var = TRUE)
dpv
dpt <- dp_table(dp, 1, align_var = TRUE, text_var = TRUE)
dpt


petermeissner/diffrprojectswidget documentation built on May 25, 2019, 1:52 a.m.