How to separate one column to multiple column (complex column)
I am trying to separate column "Grade" to multiple columns according to their subject and grade grade<-read.csv("https://raw.githubusercontent.com/tuyenhavan/Statistics/Dataset/High_school_Grade.csv",sep=";") # Rename the column names names(grade)<-c("Student_ID","Name","Venue","Grade") head(grade) # Separate `Grade` into `subject` variables and coresponding `Grade`columns library(tidyverse) df<- grade %>% separate(Grade,paste("V",1:7,sep="_"),sep=":") head(df) # It still is not separating `subject ` and `grade` independently # Here is what I want it to look like new_df<-df[c(1:5),c(1:4)] new