Whenever I am writing the reshape(), it is throwing the following specific error: failed to guess time-varying variables from their names.
How can I catch this specific error from reshaping and make: if(that specific error came up) return(NA)?
Say for instance:
input <- data.frame(id = 1:3, school = LETTERS[1:3], read_2018 =20:22, read_2019 = 30:32)
out <- reshape(input, dir = 'long', idvar = c("id", "school"), varying = c('read_2018', 'read_2019'))
# if(`out` gives that specific error) return(NA)