knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "##",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
options("width"=110)
tmp <- packageDescription( basename(getwd()) )
cat("##", tmp$Title)
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))

Status

lines of R code: r length.R, lines of test code: r length.tests

repo status AppVeyor build status Codecov

Development version

source_files <- 
  grep(
    "/R/|/src/|/tests/",
    list.files(recursive = TRUE, full.names = TRUE), 
    value = TRUE
  )
last_change <- 
  as.character(
    format(max(file.info(source_files)$mtime), tz="UTC")
  )
cat(tmp$Version)
cat(" - ")
cat(stringr::str_replace(last_change, " ", " / "))

Description

cat(tmp$Description)

License

cat(tmp$License, "<br>")
cat(tmp$Author)

Installation

You can install the released version of tabit from CRAN with:

install.packages("tabit")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("petermeissner/tabit")

Example

# load package
library(tabit)

simple vectors

# simple tabulation
tabit(mtcars$cyl)

simple data.frames

# can we do this with data.frames
tabit(mtcars[, c("cyl", "am")])

simple tibbles

# what about this tibble thing?
suppressPackageStartupMessages({
  library(dplyr)
})
mtcars %>% 
  select(cyl, am) %>% 
  tabit()

grouped tibbles

# ... and grouped tibbles?
mtcars %>% 
  group_by(cyl, am) %>% 
  tabit()

too much magic?

# use tabit_1() for vector usage
tabit_1(letters[1:4])

# use tabit_x for data.frames and tibbles
tabit_x(mtcars[, c("cyl", "am")])


petermeissner/tabit documentation built on April 2, 2020, 1:36 a.m.