0

I need to now how can I export data from r to excel but used \n Ineed save numbers one by one row by row.

Example:

1234

3233

4543

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Andres
  • 9
  • 2
  • 1
    Assuming that you have the numbers in an array `x = c(1234, 3233, 4543)` just use `write.table(x, "Output.csv", row.names=FALSE, col.names=FALSE)` – G5W Jul 22 '19 at 23:42
  • I removed the [tag:rstudio] tag, since that is for issues with the RStudio IDE, not the R programming language. If I'm incorrect in this, please edit your question and give more context. Thanks! – r2evans Jul 22 '19 at 23:47
  • If you need to save to a file, use `write.csv` or `write.table`. If you want them whole line-by-line (as in not columns), you can use `writeLines`, but that's not really specific to Excel. If you just need a quick "get this data into Excel" and don't need to save the file, see https://stackoverflow.com/q/13438556/3358272. – r2evans Jul 23 '19 at 00:25
  • @G5W, the default `sep=` for `write.table` is a space, which isn't technically CSV. This causes Excel to put each row in a single cell. I'd suggest either `write.csv` or `write.table(..., sep=",")` (which is almost the same). – r2evans Jul 23 '19 at 00:27
  • @r2evans The OP asks for a single column of numbers. The separator is not really relevant. – G5W Jul 23 '19 at 00:33

0 Answers0