I need to create long command lines in Rand pass them to system(). It is very inconvenient for me to use the function paste0/pasteor even sprintfto build each command line. Is there an easier way to do this:
Instead of these hard-to-read and too many quotes:
cmd <- paste("command", "-a", line$elem1, "-b", line$elem3, "-f", df$Colum5[4])
or
cmd <- sprintf("command -a %s -b %s -f %s", line$elem1, line$elem3, df$Colum5[4])
Can I do it:
cmd <- buildcommand("command -a %line$elem1 -b %line$elem3 -f %df$Colum5[4]")
source
share