How can I redirect R's output from the console to a file
1
1
Entering edit mode
7.7 years ago
biomagician ▴ 410

Dear all,

I am running this command:

Rsubread::buildindex(basename='output/genome/ref/index/subread/celegans',reference="output/genome/ref/seq/celegans.fa")

to build an index for the C. elegans genome. R then outputs lots of interesting information to the console.

Do you know how I can redirect that output to a file?

Thanks.

C.

rsubread redirection r output • 1.8k views
ADD COMMENT
2
Entering edit mode

If you are running this in some R environment I think sink() function will do that read here

ADD REPLY
0
Entering edit mode

Thanks, it worked. I didn't know about this function!

ADD REPLY
5
Entering edit mode
7.7 years ago
5heikki 11k
sink("yourOutput.txt")
your stuff
sink()
ADD COMMENT
0
Entering edit mode

Thanks, it worked. I didn't know about this function!

ADD REPLY
1
Entering edit mode

If this answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.

ADD REPLY
0
Entering edit mode

Done. Thanks. I had upvoted it but I had not accepted it. I didn't know about accepting.

ADD REPLY

Login before adding your answer.

Traffic: 2462 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6