Recently we had a discussion about where to find a nice cheat sheet (No! We are not talking about Simon the Sorcerer walk-throughs). Especially for scripting languages cheat sheets are an excellent way to support your learning attempts and are a handy tool for your every work in data visualisation, automation of tasks and analysis steps. So let’s have a look on R cheat sheets.
R is not S and you might need a Cheat
R is a scripting language which originated from S some years ago and has its roots in statistical computations. It was chosen as an alternative to SPSS and due to its modularity (called packages) you can enhance it quite easy. Nevertheless you might need some reminders for your everyday work and so you will probably look for a nice cheat sheet. A cheat sheet is a condensed help file with the basic syntax and a short explanation for the certain command.
Example:
The common help for the easy and useful command “strsplit” to separate parts of a string from each other:
Split the Elements of a Character Vector
Description
Split the elements of a character vector <code>x</code> into substrings according to the matches to substring <code>split</code> within them.
Usage
strsplit(x, split, fixed = FALSE, perl = FALSE, useBytes = FALSE)
Arguments
x      character vector, each element of w ....
And as you can see this is quite long. Here comes the cheat sheet:
strsplit(x,split) split x according to the substring split
Cheat Sheets for R
R can be quite cool when dealing with spatial data and geostatistics. So get yourself some support with these cheat sheets:
spatial cheat sheet
Etienne B. Racine (a gis and maps specialist) created this nice little cheat sheet with a special focus on raster datasets: filtering, sampling and editing. Supported by infographics you will get an idea about the algorithms/functions behaviour and meaning:
The second sentence on this sheet summarize it all: “The best cheat sheets are those that you make yourself!” Nevertheless Andreas Hamann from the University of Alberta created this data management cheat sheet. It’s quite long but gives you an idea about most stuff you need for everyday fun with R.
data.table lovers
If you love data.tables this cheat sheet is for you. It was made by the guys at datacamp. Not easy to read neither to print but quite useful to have it on your desktop:
hail the regression
I have to confess that I love regression analysis. So does Vito Ricci as he created the regression cheat sheet for R. It lacks of minimal examples yet you can scan the sheet quite easy and get an idea about a function:
R goes spatial
You might be interested in a handy overview for your work with geodata in R. Together with the GDAL bindings you can do a lot of stuff in R and even use the R syntax in some QGIS scripts. Nevertheless you need to know how to code. The University of Lancaster has a nicely written summary with all the packages you might already use or heard of:
Sidenote: If you’re interested in spatial methods take a look on the page of Francisco Rodriguez-Sanchez: Spatial data in R: Using R as a GIS
the one I use
I am using R mostly for ETL tasks and need more basic commands and do some basic stuff within R. So I often use the “official” R cheat sheet / reference card which I printed out and folded nicely. It provides a short summary on each command and sometimes a small example. unfortunately its format is a bit strange…
the one you use
What is your favourite cheat sheet? Have you created one for yourself and would like to share it here? Leave a comment!
I love scripting languages like R, MatLab, Python and Javascript. They are easy to learn and also fast in showing your results. But when it comes to debugging…
The main question when using remote sensed raster data, as we do, is the question of NaN-treatment. Many R functions are able to use an option like rm.NaN=TRUE…
Some months ago I published qgis2leaf which enables a QGIS user to publish a webmap the easy way. It was integrated into qgis2web which offers a leaflet and…
When I am working in new institutions and I am asking: “Do you have a document management system?” I often get the answer:”Yap, we are using folders” ……