Skip to content

Export data.table:::uniqlist for external use #900

Description

@anhqle

uniqlist is useful to detect whether there's a change in value in an R's data frame. (For example, check if a variable change values in time series data.)

See this StackOverflow question, which shows that there's no readable alternative to uniqlist

x = data.frame(cnt=1:10, code=rep('ELEMENT 1',10), val0=rep(5,10),  val1=rep(6,10),val2=rep(3,10))
x[4,]$val0=6

data.table:::uniqlist(x[, 3:5])
# [1] 1 4 5

Activity

  1. jangorecki commented on Oct 19, 2014

    @jangorecki
  2. kenklin commented on Aug 11, 2015

    @kenklin

    I was looking for this functionality and found the StackOverflow post mentioned by LaDilettante with Arun's suggestion to file an issue in GitHub. I then discovered this opened issue. I too am now using uniqlist and would like to see it exported. Thanks for the useful work.

  3. self-assigned this
    on Apr 10, 2020
  4. jangorecki commented on Apr 10, 2020

    @jangorecki
    Member

    I think we should rename this function for exporting. Current name will be confusing, as we now have rbindlist (do.call(rbind, ...)), and cbindlist and mergelist are coming to also provide corresponding reduction using cbind and merge.
    If anyone has some idea for new name please put your feedback here.
    According to comments in code, and reference to base::order, which mentions bash uniq, the name uniq seems reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions