Created
October 4, 2020 11:33
-
-
Save rhilfi/09259e9574c5fdc2bf1041317995f59b to your computer and use it in GitHub Desktop.
rename_column_names_with_rename_all_and_str_replace # R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
Dieser_Alte_Hase=rnorm(10,2,2) | |
Dieses_Alte_Pferd=rnorm(10,4,2) | |
Dieses_Alte_Haus=rnorm(10,4,2) | |
data<-data.frame(Dieser_Alte_Hase, Dieses_Alte_Pferd, Dieses_Alte_Haus) | |
names(data) | |
data<-data %>% | |
rename_all(~str_replace(., "_Alte_", ".Junge.")) | |
names(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment