[Solved] Convert a schedule (in wide form) to long form in R and select only some rows [closed]
If your schedule is stored as a matrix or data frame, you can use the reshape2 package: # generate a fake schedule sched <- matrix(rbinom(25, 1, 1/2), 5, dimnames = list(1:5, c(“Mo”, “Tu”, “We”, “Th”, “Fr”))) library(reshape2) melt(sched) # Var1 Var2 value # 1 1 Mo 0 # 2 2 Mo 0 # 3 3 … Read more