Insights  /

Setting up R

A programming language is a system of notation that enables humans to instruct computers to execute specific tasks. Although the format and purpose of programming languages differ, they are all structured around a collection of symbols, punctuation and syntax. Although there are ‘general purpose’ programming languages (like python), most languages tend to work best for a specific situations.

The R programming language is a great example of this. As while you can use it for a wide variety of tasks, it is best suited for statistical analysis and data visualization.

The base installation of R includes a set of basic (but still powerful) functions and packages useful for conducting statistical analysis. It is freely available for Windows, Mac and Linux and can be downloaded here. Once installed, you can access R via the console (see below).

Although the purpose of this post isn’t to introduce to the R language, to get a sense of how it feels to work with R you can enter the code below which generates a set of 100 random data points, saves them as ‘dta_rnorm’ and produces a scatter plot using the plot() function.

The command install.packages(‘tidyverse’) installs the ‘tidyverse’. R packages are a collection of tools, documentation and data that can be installed to expand the functionality of R. At the time of writing there were over 25,000 R packages available. However, the tidyverse packages are some of the most popular as they are designed to provide a powerful set of tools that are needed when working with data.

You’ll also probably also want to install a better IDE or ‘Integrated Development Environment’ when working with R, which is where Rstudio comes in. Like R, RStudio Desktop is also freely available for Windows, Mac and Linux here.

Subscribe for Updates:

Share this post

Related Posts

You might also like the following insights related to this

Subscribe for updates

Subscribe to get the latest updates and insights from PolicyAnalysisLab.com

By signing up you’re confirming that you agree with the terms and conditions outlined in our privacy policy.