Save data out of the console in a table (RStudio)


I'm absolutely new to R and I have a maybe stupid question.
I tried to do a lowess smoothing, with the following code:

write.table(lowess(furR$haircellindex ~ furR$width))

This works fine. But the results are given in the Console. My question is how to save the results in a table, that I can later export to excel?

Thanks for help.

The documentation of the write.table function shows that it has a parameter called file that takes the name of the file that is written. If you do not provide it, the output goes to the console. You can see the documentation with the command



write.table(lowess(furR$haircellindex ~ furR$width), file = "MyFile.txt")

That will produce a space delimited text file. The write.table function has a sep parameter that you can set to "," if you want a comma delimited file. Excel should be able to import either one of those formats.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.