Beginners Guide to R Programming

Beginners Guide to R Programming

R is hot, whether measured by its 4,400 add-on packages, by 18,000+ individuals from LinkedIn’s R gathering. There can be a little doubt that interest in the R statistics language is soaring.

Why R? It’s free, open source, powerful and highly extensible. Google’s chief economist said “You have a considerable measure of prepackaged stuff that is as of now accessible, so you’re standing on the shoulders of giants”.

THE FIRST STEP

To begin with R, open r-project.org to download and install R for your desktop or laptop. It runs on Windows, OS X and “a wide variety of Unix platforms”.

R prpogramming blog-image

 

Installing R is actually all you need to get started. However, I’d also suggest to install the free R integrated development environment (IDE) RStudio. It has got useful features that you’d expect from a coding platform, such as syntax highlighting and tab for suggested code auto-completion. I also like its four-pane workspace, which better manages multiple R windows for typing commands, storing scripts, viewing command histories, viewing visualizations and more.

Learning the shortcuts

Wickham, the RStudio chief scientist says, there are three most important shortcuts in RStudio:

Tab is a generic auto-complete function. If you start typing in the console or editor and hit the tab key, RStudio will suggest functions or file names.

Control + the up arrow is a similar auto-complete tool. Start typing and hit that key combination, and it shows you a list of every command you’ve typed starting with those keys.

Control + enter takes the current line of code in the editor, sends it to the console and executes it.

Setting the Working Directory

Change your working directory with the setwd() function, such as:

setwd(“~/mydirectory”)

Note that the slashes always have to be forward slashes, even if you’re on a Windows system. For Windows, the command might look something like:

setwd(“C:/Desktop/Documents/RProjects”)

Installing and using package

R has several built in packages and if you want to work on a particular package then you have to install the package by using the following command:

install.packages(“the package name”)

To see the packages which are already installed on your system, type:

installed.packages()

Help

If you need help about a function, you can type help with the function name.

Help (functionName)

So, this was a small guide for a beginner who want to start his career in R programming. To get deep knowledge about R, you can register with easylearning.guru which provides R Programming Course Curriculum and certification as well.

Author

Anurag is a techno freak who loves to play with technology, and for this, he is known “Internet nut” at his workplace. Being a self-motivated person, he wants to make a difference in this world. He is sporty, addicted to coffee, fond of music and a simple life loving person.

Leave a Reply