Please pardon me for such silly question.
If I want to build a try as this: 2 "", "Try1", n-1 "", "Try2", n-1 "", which n is number of elements in Level.
level <- c("L1", "L2", "L3", "L4")
try<- t(c("","", "Try1" ,"","","", "Try2","","", ""))
Is it a way to build try in a way like 2"", "Try1", (length(level)-1)"", "Try2", (length(level)-1)""?
>Solution :
We may use
n <- length(Level) - 1
tail(na.omit(c(mapply(`c`, replicate(n, rep("", n),
simplify = FALSE), c(paste0("Try", 1:2), NA)))), -1)
[1] "" "" "Try1" "" "" "" "Try2" "" "" ""