sparklyr change all column names spark dataframe
I intended to change all column names. The current rename or select operation is too labouring. I dont know if anybody has a better solution. Examples as belwo: df <- data.frame(oldname1 = LETTERS, oldname2 = 1,...oldname200 = "APPLE") df_tbl <- copy_to(sc,df,"df") newnamelist <- paste("Name", 1:200, sep ="_") How do I assign newnamelist as the new colnames? I probably cant do this: df_new <- df_tbl %>% dplyr::select(Name_1 = oldname1, Name_2 = oldname2,....) You can use select_ with .dots : df <- copy_to(sc, iris) newnames <- paste("Name", 1:5, sep="_") df %>% select_(.dots=setNames(colnames