I have this chunk of code
# Select the columns
WD_selected <- WD %>%
select(Div, Date, Time, HomeTeam, AwayTeam, FTHG, FTAG, FTR, HTHG, HTAG, HTR, HS, AS, HST, AST, HF, AF, HC, AC, HY, AY, HR, AR)
which aplies to one data frame.
I want to do the same in 30 dataframes.
In the following chunk of code how can I identify a dataframe inside the curly brackets?
What shall I right instead of i_selected <- i
Nome_Base <- "I1"
Numero_Ficheiros <- 30
Numero_Ficheiros <- 1:Numero_Ficheiros
Lista_Data_Frames <- paste0(Nome_Base, "_", Numero_Ficheiros)
for (i in Lista_Data_Frames) {
i_selected <- i %>%
select(Div, Date, Time, HomeTeam, AwayTeam, FTHG, FTAG, FTR, HTHG, HTAG, HTR, HS, AS, HST, AST, HF, AF, HC, AC, HY, AY, HR, AR)
}