App: App

Description Usage Arguments Details Examples

Description

This class represents a spatial app and its associated usage data.

Usage

1
2
3
4
5
6
7
8
9
app = App$new("My app", x)

print(app)

app$users()
app$user_count()
app$get_user(user_id)
app$actions_map(flavor = "leaflet")
app$first_actions_map()

Arguments

name

Character scalar, the name of the app.

usage_data

An sf object, representing the usage data for the app.

Details

$new() sets up the class with two properties: name and usage_data

$print() prints out some basic identifying information about the app.

$users() returns a vector containing the unique ids of the app's users.

$user_count() returns a count of the app's users.

$get_user(user_id) returns an object of class User. This object represents the user that matches the given id.

$actions_map(flavor = "leaflet") draws a map showing the spatial distribution of the app's usage, color coded by action. Choose either the "leaflet" or "mapview" version of the map using the flavor parameter.

$first_actions_map() draws a map showing locations where users tried the app for the first time.

Examples

1
2
3
x = read.spud("dummy_data.csv")
app = App$new("My app", x)
app$actions_map(flavor = "mapview")

lbraun/spud documentation built on May 9, 2019, 5:50 a.m.