Here is my dataset:
record_id voucher_number ice sets
<int> <chr> <chr> <chr>
1 1 app1 app app
2 1 00000 1 1
3 1 11111 1 2
4 1 22222 1 3
5 1 11111 2 4
6 2 app2 app app
7 2 33333 1 1
8 2 44444 1 2
9 2 33333 2 3
10 2 33333 3 4
11 3 app3 app app
12 3 55555 1 1
13 3 66666 1 2
14 3 55555 2 3
15 3 66666 2 4
16 3 55555 3 5
17 3 77777 1 6
I am trying to create another variable column to represent different combinations of record_id
and voucher_number
in set
. When I use the following snippet of code
dplyr::group_by(
record_id,
voucher_number
) %>%
dplyr::mutate(
instrument = row_number(),
instrument = replace(instrument, is.na(voucher_number), "application"),
voucher_sets = cur_group_id()
)
I am getting the following error:
Error in cur_group_id() : could not find function "cur_group_id"
Any idea what may be going on wrong here. Also the posted dataset is not the true dataset I am working with.