knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "##",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
options("width"=110)
options(max.print=100)

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

Project Status: Active – The project has reached a stable, usable state and is being actively developed. 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(stringb::text_replace(last_change, " ", " / "))

Description

cat(tmp$Description)

License

cat(tmp$License, "\n\n")
cat(tmp$Author)

Citation

citation("sar")

BibTex for citing

toBibtex(citation("sar"))

Installation

Installation and start - development version

devtools::install_github("petermeissner/sar")
library(sar)

Usage

library(sar)
sar_stat <- 
  function(...){
    tmp      <- sar::sar_stat(...)
    tmp$node <- "Server1"
    tmp
  }

simple usage

sar_stat() %>% head()

simple usage to wide format

sar_stat(to_wide = TRUE) %>% head()

get data for yesterday

sar_stat(day = -1) %>% head()

get data for day before yesterday

sar_stat(day = -2) %>% head()

get data for last 20th calender day

sar_stat(day = 20) %>% head()

get data for remote server

sar_stat(server = c("localhost", "localhost")) %>% head()

and now vectorized on server and day

sar_stat(day = -c(1:5), server = c("localhost", "localhost")) %>% head()

but best of all is plotting

# TBD #  sar_stat() %>% plot()


petermeissner/sar documentation built on May 16, 2019, 4:48 p.m.