Description Usage Arguments Value Examples
A function like mutate but operates only within a group_by and only operates on the last group rather than every group.
1 | mutate_last(.data, ...)
|
.data |
a dataframe or data table |
... |
conditions or set of conditions to mutate on last/greatest group |
a mutated dataframe or data table
1 2 3 4 5 | DF %>%
group_by(is.exit = measure == 'exit') %>%
mutate_last(qty.exit = qty, cf = 0, delta.watts = 13) %>%
ungroup() %>%
select(-is.exit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.