knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(punkapi)
res <- httr::GET("https://api.punkapi.com/v2/beers", query = list("per_page" = "80"))
check_results(res)
df <- httr::content(res)

# retrieve a specific summary (tibble) for a beer class object
# df must be a list of dataframes of beer class object


# Not works
summary.beer(df)

# works
attr(df, "class") <- "beer"

summary(df)


ThinkR-open/punkapi documentation built on Dec. 31, 2020, 5:32 p.m.