in R, can I stop print(cat(“”)) from returning NULL? and why does cat(“foo”) return foo>

后端 未结 6 894
一整个雨季
一整个雨季 2021-02-18 20:00

If I enter

print(cat(\"\"))

I get

NULL

I want to use cat() to print out the progress of an R sc

6条回答
  •  野性不改
    2021-02-18 20:26

    I do not see the need to use print(cat()). To printing a message cat() is already sufficient. This may be what you are looking for:

      for (j in 1:n) {
         cat("Running loop", j, "of", n, "\n")
      }
    

提交回复
热议问题