update: Update a dataframe, functional style

Usage Arguments Value Author(s) See Also Examples

Usage

1
update(d, where = NULL, by = NULL, what = NULL)

Arguments

d

A dataframe

where

A list of expressions evaluating to booleans

by

A list of expressions defining the groups

what

A list of aggregates expressions

Value

A dataframe, same number of rows as original d object

Author(s)

JFP

See Also

select

Examples

1
2
3
4
5
6
d <- data.frame(
    date=seq(as.Date("2001-01-01"), as.Date("2001-12-01"), by="month"),
    ticker=sample(c("1 HK", "2 HK"), 12, TRUE),
    return=rnorm(12)
  )
d %>% update(by=list(ticker=expression(ticker)), what=alist(return=2)) 

HikaGenji/fql documentation built on April 12, 2021, 8:36 a.m.