R: Make sure command output is piped to sink()

In an R script when using sink() to output the results of commands to a file you will often get a blank file whereas if you copy and paste the same command into the R shell it will work fine. There are two ways round this:
  1. Wrap all commands with the print() fucntion
  2. When sourcing the file make sure that echo is set to TRUE i.e. source("input.r", echo=TRUE)

Comments

Popular posts from this blog

A census of amplified and overexpressed human cancer genes : Nature Reviews Cancer

RT @CancerInNorwich: 📢 Join us on Monday at 1pm for the next talk in our virtual seminar series. We will be hearing from Dr Wafa Al-Jamal from @QUBelfast, who will be talking about "Smart Nanomedicimes for Pancreatic Cancer". All are welcome to join via the MS Teams link: https://t.co/4xCYpjGuBZ https://t.co/EGyD4NAgeP

An excellent opportunity to join the cancer genetics team as a diagnostic lab bioinformatician in Norwich. Lots of exciting projects to get involved in. Deadline: 30/05/2023. Happy to chat about this role. https://t.co/SltGsxYF6Y https://t.co/zh08bqZFDb