Rate limited by GitHub when using remotes::install_github()

When you use remotes::install_github() too often in a short span of time, GitHub may rate limit you. This means you can’t use install the package you wanted without waiting for the rate limit to end. One way around this (and to prevent getting rate limited) is to simply clone the repo and use remotes::install_local()! To…

Continue Reading

Find out which function is being used in R

Today I learned of the utils::getAnywhere() function in R, which I discovered when looking for a way to determine which function is going to be used when two attached packages have the same function name. I knew of base::search() which provides the search path used by R to look for objects (remember that everything in…

Continue Reading

Prevent download errors in R by increasing the timeout

If you find yourself getting a "Timeout of 60 seconds was reached" warning from download.file that’s preventing you from installing a package, you can increase the timeout in R by using options(). For example, when I was trying to run the following command: SeuratData::InstallData('ifnb') trying URL 'http://seurat.nygenome.org/src/contrib/ifnb.SeuratData_3.1.0.tar.gz' Content type 'application/octet-stream' length 413266233 bytes (394.1 MB)…

Continue Reading

Getting something to work once is not hard

As I wrote in a post on where to get information, I have been switching to offline resources such as books as a source of information. I’ve probably bought too many physical books as of late but I am reading them! One book that I’ve started to read is Clean Architecture by Robert C. Martin,…

Continue Reading

Naming variables and functions

An important aspect of programming that I never paid much attention to is the naming of things such as variables and functions. I think the reason is because a script/program will work as long as the syntax is correct and the naming of things is unimportant to the computer. When I first learned programming as…

Continue Reading

TIL about code snippets in RStudio

Last updated: 2023/07/28 I recently learned about code snippets in RStudio (ignore the strikethrough). As the name suggests, they are snippets of code that you can quickly insert into your source code in the source pane of RStudio. There are two ways to add code snippets: Click on the following: Tools -> Global Options ->…

Continue Reading

Wrap and unwrap a line in Vim

Last updated: 2023/07/06 Vim is a text editor that is renowned for having a steep learning curve. People like to illustrate its difficulty by pointing out that Vim is so unfriendly to new users that they do not even know how to quit the program! I learned Vim (and Perl) because that was what my…

Continue Reading

TIL that you can download SRA data from AWS

The Sequence Read Archive (SRA) is the largest publicly available repository of high throughput sequencing data. (Fun fact: it used to be called the Short Read Archive since most of the data was from short read sequencers.) The tool fastq-dump from the SRA Toolkit can be used to download SRA data. A while ago I…

Continue Reading

Grepping PowerPoint files

Last updated: 2023/03/07 I’m not really a fan of PowerPoint but it’s ubiquitous in research, so I have to work with them. Sometimes I need to find a slide amongst a pile of PowerPoint files and waste a lot of time opening and closing files. I wondered whether I could grep PowerPoint files and sure…

Continue Reading

Stop BLAST from phoning home

Some time back I learned from Devon Ryan on the bird app (no link because I have stopped using said app) that BLAST phones home every time you used it, by default. I was never aware of this until I saw the post and I’m not really a fan of having this turned on by…

Continue Reading