0

I can use print(70*"_") in python to output dashed line as a separator between results. Now how can I output the same results in R.

  • 3
    Does this answer your question? [How to repeat a String N times in R?](https://stackoverflow.com/questions/22359127/how-to-repeat-a-string-n-times-in-r) – Jan Jaap Meijerink Jan 20 '22 at 12:43

2 Answers2

2

strrep("_", 70) this is just a base R function

[1] "______________________________________________________________________"

Merijn van Tilborg
  • 5,452
  • 1
  • 7
  • 22
1
print(paste(rep("_", 70), collapse = ""))

This works, but maybe there is a more elegant solution (it should also work without print())

bt-koch
  • 59
  • 5