PROBLEM STATEMENT
I have a table in which some columns begin with a string that I would like to remove. I have tried to do that by using the new "across" functionality from dplyr, and the functions from stringr to manipulate strings, but I have failed (that's why I am here!).
EXAMPLE CODE
library(tidyverse)
# Generate a short mock-up table
set.seed(1)
mockup <- tibble(n_col1 = sample(1:10, 5, FALSE),
v_col2 = sample(letters, 5, FALSE),
col3 = sample(10:20, 5, TRUE),
col4 = sample(LETTERS, 5, FALSE)) # More columns beginning with "n_", "v_" or nothing
# Remove the "n_" or "v_" strings from the column names
# This is as far as my skills go...
mockup <- mockup %>% mutate(across(starts_with(c("n_", "v_")), str_remove))
QUESTION
Any ideas how to do this, either in my way or in a different way, in an short and efficient fashion?