get_home: Predict which cluster is an individual's home.

Description Usage Arguments Value Dataframe Requirements See Also Examples

View source: R/gps_home.R

Description

Predict which cluster is an individual's home.

Usage

1
2
3
4
5
6
7
8
get_home(
  df1,
  df2,
  home.start = "00:00:00",
  home.end = "06:00:00",
  filt = TRUE,
  max.distance = 150
)

Arguments

df1

A dataframe of GPS coordinates as described below.

df2

A dataframe with named clusters (most likely the dataframe that is returned after running reduce_multi OR the places dataframe that is returned after running get_clusters).

home.start

A character vector HH:MM:SS which represents the start time that most individuals will be asleep by.

home.end

A character vector HH:MM:SS which represent the start time that most individual may start to wake up by.

filt

A logical T or F if the GPS data should be filtered between home.start and home.end. The default is T.

max.distance

An integer in meters. It is the maximum distance in meters a cluster can be from the home location to be labelled as "home". The defaults is 150 m.

Value

Returns a list of dataframes. COUNT is a dataframe that count how many times an individual was at a clusters HOME is a dataframe with clusters labelled as "Home", "Other", "In Transit"

Dataframe Requirements

The dataframe needs to have the following named columns:

See Also

get_clusters to cluster GPS coordinates into places.

get_places to label each cluster's place type as identified by Google Places API

Examples

1
2
3
4
5
6
## Assume you have run get_clusters() on the dataset "places_gps"
## Not run: 

home <- get_home(places_gps, clusters[[1]], home.start = "21:30:00", home.end = "09:30:00")

## End(Not run)

places documentation built on April 8, 2021, 9:06 a.m.

Related to get_home in places...