User: User

Description Usage Arguments Details Examples

Description

This class represents a user of a spatial app.

Usage

1
2
3
4
5
6
7
user = User$new("User 1", x)

print(user)

user$first_action()
user$actions_map(flavor = "leaflet")
user$path_map()

Arguments

id

Character scalar, the id of the user.

usage_data

An sf object, representing the usage data of the user.

Details

$new() sets up the class with two fields: id and usage_data

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

$first_action() returns a spatial feature representing the first action of the user.

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

$path_map() draws a map showing the path of the user over time.

Examples

1
2
3
x = read.spud("dummy_data.csv")
user <- User$new("User 1", x)
user$actions_map(flavor = "mapview")

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