summarise_.tracks: Summarise a tracks variable to a higher table.

Description Usage Arguments Value See Also Examples

View source: R/dplyr_verbs.R

Description

Summarise a tracks variable to a higher table.

Usage

1
2
## S3 method for class 'tracks'
summarise_(.data, ..., .target = NULL, .dots)

Arguments

.data

A tracks object.

...

Summary expressions, such as mean(speed, na.rm = TRUE), or var_pd = var(pair_dist, na.rm = TRUE).

.target

To which tables you want to summarize them. By default loses the last grouping, and follows the lines in this diagram.

Value

A tracks object.

See Also

dplyr::summarise

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Guppies <- as_tracks(guppies, 30,  1080) %>%
  expand_tracks() %>%
  join_tr_to_soc(X, Y) %>%
  mutate(d = pair_dist())

summ <- summarise(Guppies, mx = mean(X, na.rm = TRUE), s = sum(d, na.rm = TRUE))

summ$animal #now has mx column
summ$pair   #now has s column

summ2 <- summarize(summ, mx2 = mean(mx), s2 = sum(s))

summ2$trial #now has mx2 and s2 columns

Ax3man/trackr documentation built on Oct. 8, 2019, 10:53 p.m.