1

I have an R script which writes a table with the following line:

print(write.table(dat, sep =",", row.names=FALSE))

The result if I pipe to CSV (or print to STDOUT on the command line) is:

enter image description here

How can this be avoided?

Thanks for your insight <3

AgileDan
  • 361
  • 1
  • 2
  • 21
  • 3
    The NULL is probably coming from the `print()`. Is that necessary? It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Oct 18 '19 at 18:17
  • @MrFlick, you were correct, it was because of using ```print()``` – AgileDan Oct 18 '19 at 18:19
  • 1
    @Mr.Thorn Answering your own question (not in a comment) and accepting this answer as a solution is a good way to close a question on SO. :-) – Biblot Oct 18 '19 at 19:13

1 Answers1

0

Not using print() solved the issue

AgileDan
  • 361
  • 1
  • 2
  • 21