I have a list of dataframes that all contain a matching ID column.
For example...
dat1 = tribble(
~id, ~response,
"id_1", 10,
"id_2", 15
)
dat2 = tribble(
~id, ~response,
"id_3", 20,
"id_4", 25
)
example_list <- list(dat1, dat2)
> list(dat1, dat2)
[[1]]
# A tibble: 2 × 2
id response
<chr> <dbl>
1 id_1 10
2 id_2 15
[[2]]
# A tibble: 2 × 2
id response
<chr> <dbl>
1 id_3 20
2 id_4 25
How can I map across the dataframes to remove the "id_" prefix for each row on the id column using str_remove()?