summary

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = " # "
)
options(width =100)

replyr_summary example.

replyr_summary works on various data sources, counts NA, and returns a data.frame (instead of text).

d <- data.frame(x=c(NA,'b'), y=c(1,NA), stringsAsFactors= FALSE)

summary(d)

replyr::replyr_summary(d)

execute_vignette <- requireNamespace("RSQLite", quietly = TRUE)
if(execute_vignette) {
  my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
  RSQLite::initExtension(my_db)
  dbData <- dplyr::copy_to(my_db, d)

  summary(dbData)

  replyr::replyr_summary(dbData)

  # glimpse works more like str or head
  dplyr::glimpse(dbData)
}
DBI::dbDisconnect(my_db)
rm(list=ls())
gc()


Try the replyr package in your browser

Any scripts or data that you put into this service are public.

replyr documentation built on Nov. 1, 2019, 7:49 p.m.