I have this code for a individual dataframe
df_MDE <- df_MDE %>%
rename("PAIS" = "MS",
"NPC" = "PARTNER",
"NC" = "COMM",
"PAIS_COD" = "COUNTRY",
"QT_UNID_SUPL" = "QTY_SU")
df_MDE$NC2 <- substr(df_MDE$NC, 1, 2)
I want to apply it to this list of dataframes:
prefix <- "df_MDE_"
VECTOR_MDE <- paste(prefix, VECTOR_ANO_MES, sep = "")
LIST_MDE <- as.list(VECTOR_MDE)
But I get the following error:
Error in UseMethod("rename") :
no applicable method for 'rename' applied to an object of class "character"
which states that the list is not a list of dataframes but only a list of four characters.
How can I solve this problem?