suma_from_api: Gather data from the Suma API

Description Usage Arguments Examples

View source: R/data.R

Description

This function hits the Suma API for the selected initiative ID during the given date range.

Usage

1
2
3
suma_from_api(url = "https://library.dartmouth.edu/sumaserver/",
  initiativeId = 1, startDate = cut(Sys.Date(), "month"),
  endDate = Sys.Date(), sepDates = TRUE, unnest = TRUE)

Arguments

url

The base url, defaults to Dartmouth's https://library.dartmouth.edu/suma/

initiativeId

The desired initiative to retrieve data for, defaults to 1

startDate

Desired start date, defaults to beginning of current month

endDate

Desired end date, defaults to today's date

sepDates

Creates columns for easy grouping and sorting of date and time from sessionStart

unnest

If TRUE, separates counts with multiple activities into one row per activity

Examples

1
df <- suma_from_api("https://library.dartmouth.edu/sumaserver/", 1, "2016-04-01", "2016-08-01")

jladams/sumar documentation built on May 19, 2019, 12:45 p.m.