gunique {timeplyr}R Documentation

Grouped unique(), sort() and duplicated()

Description

These functions use collapse and are like the collapse counterpart but differ in that they accept a group g argument which allows for more flexible by-group sorting.

Usage

gunique(x, g = NULL, sort = FALSE, order = TRUE, use.g.names = TRUE)

gduplicated(x, g = NULL, order = TRUE, all = FALSE)

gwhich_duplicated(x, g = NULL, order = TRUE, all = FALSE)

gsort(x, g = NULL, order = TRUE, use.g.names = TRUE)

gorder(x, g = NULL, order = TRUE)

Arguments

x

A vector or data frame.

g

Object used for grouping, passed directly to collapse::GRP().
This can for example be a vector or data frame.

sort

Should the result be sorted?
This only applies to gunique().

order

Should the groups be treated as ordered groups? Default is TRUE.

use.g.names

Should group names be used? Default is TRUE.

all

If TRUE, gduplicated() returns all duplicated values, including the first occurrence.


[Package timeplyr version 0.5.0 Index]