Regarding factoring in R
问题 I have this code where currently I am displaying for 2 patients but I have to group the 3 records and display them for more than 15 patients. Currently I am factoring for each patients as below but is there any way to use factor with grep so that my factor won't become so tedious pat_paste_c<-factor(pat_paste_c,levels=c('Pat_1_IT-6','Pat_1_IT-7','Pat_1_IT-8',"Pat_2_IT-6","Pat_2_IT-7","Pat_2_IT-8"),ordered = TRUE) c<- data.frame(Var=character(), Pat_1=double(), Pat_2=double(), stringsAsFactors