Hello people !
I am new to R and learning it.
I am trying to learn the names_pattern () function wherein a blog blogger has used a code in the "who" dataset that I am unable to understand.
who %>% pivot_longer(
cols = new_sp_m014:newrel_f65,
names_to = c("diagnosis", "gender", "age"),
names_pattern = "new_?(.)_(.)(.)",
values_to = "count"
)
Can anyone please explain how he used this - names_pattern = "new_?(.)_(.)(.)" and also how to use this syntax.
Provide any link to a blog or video wherein I can learn from.
Thank you!