You should cat a newline character twice. By writing cat(x); cat('\n'); cat(x)
, with x=="test"
you if fact print("test\ntest")
-- there's only one newline here.
A possible solution:
prnt.test <- function(x){
cat(x, sep="\n\n")
}
prnt.test(c("test1", "test2", "test3"))
## test1
##
## test2
##
## test3