mark_speed_gaps: Mark speeds that exceed a certain speed limit as gaps

Description Usage Arguments Value Credit Author(s) See Also Examples

View source: R/mark_speed_gaps.R

Description

Mark speeds that exceed a certain speed limit as gaps

Usage

1
2
3
4
mark_speed_gaps(
  tracks, speed_limit, cspeed = "speed", bind = TRUE, drop = TRUE,
  cname = "speed_gap", t_id = "id"
)

Arguments

tracks

psyo. Data frame with tracks.

speed_limit

numeric. Values in column cspeed that are equal or higher than this value will be marked as gaps in column cgaps as TRUE.

cspeed

character. Column name of tracks that contains the speed as numeric values.

bind

logical. Return the distance as list (FALSE) or add it to tracks (TRUE).

drop

logical. If TRUE and only one observation is returned drop the data frame and collapse the return value to a vector.

cname

character. Column name of tracks that marks gaps with TRUE. If the column does not exist it will be created.

t_id

character or numeric. Column name in tracks that identifies the separate tracks.

Value

psyo

Credit

If you use 'psyosphere' for commercial use or research, please support us by include one off the following references:

Author(s)

Benjamin Ziepert. Please send feedback to: feedback-psyosphere@analyse-gps.com.

See Also

mark_gap_segments, mark_time_gaps, select_gaps

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
# Get example data
data(psyo_rounds2)
speedt <- psyo_rounds2[ c(1:5,11:15) ,]
remove(psyo_rounds2)

# clean-up data
speedt <- average_duplicates(speedt)
speedt <- t_time_difference(speedt)
speedt <- mark_time_gaps(speedt)

# Add speed
speedt <- t_speed(speedt)

# Advanced mean speed without speed gap
des_mean(speedt, "speed", "time_difference", "time_gap")

# Mark speed gap
speedt <- mark_speed_gaps(speedt, 8)

# Advanced mean speed with speed gap
des_mean(speedt, "speed", "time_difference", c("time_gap","speed_gap"))

## End(Not run)

psyosphere documentation built on July 2, 2020, 12:08 a.m.