Open daviddalpiaz opened 2 years ago
I'm currently running the following on the -assign.Rmd
files as a part of my build process for a course:
remove_extra_newlines = function(file) {
input = readLines(file)
output = which(input == "")
output = input[-(output[which((output + 1)[-length(output)] == output[-1])])]
output = output[-length(output)]
writeLines(text = output, con = file)
}
Assignment R Markdown files created with
assignr
have one additional newline for each (solution) chunk removed.