Nick logo Credibly Curious

Nick Tierney's (mostly) rstats blog


Get Good with R: Typing Skills and Shortcuts

Nicholas Tierney

Categories: blag rbloggers rstats Tags: blag data science rbloggers research software engineer rstats teaching

8 minute read

Full Send. A blank trail blaze with a fun message. Fuji X100V

Previously, I wrote a blog post, “How to get good with R”, where I touched on a bunch of ideas on how to improve your R skills, focussing on the coding aspect. It is by no means definitive, and I kind of wish I had named it “How to improve your R skills” or something less grandiose. But it was a catchy title. Anyway, I digress. I said I would write another post about the non coding side, but it started to get really big, so I’m breaking them into smaller blog posts, as I think this gives me a bit more mental space to write well on a smaller topic. I will be linking the posts below here as I write them.


Here’s the jam - if you can type faster, then you operate closer to the speed of thought. It’s not just about working faster, as much as it is about being able to clearly express what is in your head. I think when you can clearly express what is in your head, then you put yourself in a good position to enter the wonderful flow state of programming. Flow state, “in the zone”, is where you are completely absorbed, enjoying what you are doing, and things often feel easy and make sense. It’s a good thing. And when you are typing fast, and accurately, you aren’t making too many small stumbling mistakes that would take you out of the flow state. Similarly, when you can use keyboard shortcuts, you are getting more of what is in your head onto the screen fluently, which helps you stay in the flow state.

Typing accurately and fast

My (not entirely clean) Keyboard, Fuji X100V

Hadley Wickham tweeted about typing speed back in 2019. My friend Miles had written something about this, I think - although I can’t find it on his blog or twitter. But Miles noticed that an improvement in his typing speed helped him stay in the programming flow state. He was already a very talented programmer at this stage, so it’s basically like giving Usain Bolt a pair of roller skates and asking him to race someone downhill.

I don’t think being a fast typist is necessary to be a better programmer, but I think tools that help you work faster and with less resistance are good. I remember changing to a new keyboard, and I felt this friction where I couldn’t put what was in my head onto the screen. I felt like I was slow - like I was walking around with a bunch of ankle weights and a large unwieldy backpack. Like a lot of things in life, taking time to revisit the basics helps you with more advanced skills. I took time every day for a couple of months to work on my typing speed, and it resulted in more accurate, faster typing. Which resulted in faster coding. I ended up ditching the new keyboard, but I kept my typing skills.

There are a lot of options out there for programs to help with typing speed. It’s important to remember to focus on accuracy first. There’s not a lot of benefit to being able to type the wrong and intelligible words really quickly. I liked keybr a lot, and I’ve heard good things about monkeytype.

Also worth noting that I don’t think you need to get a new keyboard to be a faster at typing. I still think that my old mac wireless keyboard (pictured above) is my favourite. I’ve spent a lot of time and money trying to find a good keyboard. I’m not there yet. I think it is a better use of your time to practice typing, than to buy a new keyboard. But hey, you might find that isn’t true for you! Get the keyboard if you want it, I say.

Use keyboard shortcuts

My old laptop keyboard with some worn down shortcut keys. Fuji X100V

Learn some keyboard shortcuts, it saves not just keystrokes or your time, but it helps you operate a bit closer to the speed of thought. Here are some shorcuts I use that aren’t R related a lot:

I use a screenshot tool, shottr, for Mac that gives you better control of screenshots - opening up a window that lets you crop an image, get colour swatches, save the screenshot to a given directory. It’s really nice, and it’s free.

In a web browser:

(Some of) My favourite shortcuts I use in R:

It is a small but very useful benefit with being able to move the cursor across by one word or jumping to the start or end of a line. It means you don’t have to lean on the left or right arrow key to end up where you want - you speed up that process quite a bit!

You can see a quick menu display shortcuts in RStudio with: Alt + Shift + K (press Esc to remove the screen)

And you can see all shortcuts and set your own shortcuts in Rstudio by navigating to “Keyboard Shortcuts Help” (Tools > “Keyboard Shortcuts Help”) (Official notes on customising keyboard shortcuts in the RStudio IDE).

Some packages add keyboard shortcuts as “add-ins” in RStudio, which you can then add as shortcuts using “keyboards shortcuts help”.

Some examples of these add in shortcuts are:

Garrick Aden-Buie also has a nice R package that allows you to set other keyboard shortcuts, shrtcts

I really like using my keyboard shorcuts, they help me more fluidly move between tasks, and help me stay in that flow state, that zone.

A brief note about vim and emacs and friends

All these keyboard shortcuts are super useful. So much so that there are whole other ecosystems that are built on nice shortcuts. Both emacs and vim are pieces of software/philosophies that take this shortcut idea to another level. I personally don’t use them, but I know plenty of people who do use them, and really enjoy doing so.

A word of warning, if you use vim - know how get out of vim: Esc then : then q, then Enter. If you want to learn the basics of vim, openvim and vim-adventures are great. You can set RStudio to use vim or emacs key bindings if you want (see Tools > Global Options > Code > Editing Tab > Keybindings), but I haven’t used this before, so I’m not sure what the experience is like.


I hope that these are helpful tips! Are there any keyboard shortcuts I missed? Ones that you particularly like? Other points on typing speed or ways to get faster?