segment_1: segment_1

Description Usage Arguments Value

View source: R/segment_1.R

Description

A version of "segment0" that could be passed onto a pipe function. Note: "segment0" is a function that separates different shifts

Usage

1
segment_1(data, speed, time_diff, threshold)

Arguments

data

The data with speed and time_diff to be separated.

speed

the variable name of speed to be segmented in the data.

time_diff

the variable name of time_diff to weight the speed in the data.

threshold

the threshold that is needed to segment the speeds. (the unit of threshold is an hour)

Value

shift number, which is a vector which indicates the separated shift numbers, with 0 indicated time of taking a rest.


caimiao0714/MiaoTruck documentation built on May 28, 2019, 7:14 p.m.