
Some more than a year and a half ago I was one of those who said with conviction “No, programming is definitely not for me.” I would not venture to say that I became a programmer, but over the past year
R has replaced me with most everyday programs for work. I work as a researcher. I observe with interest how gradually R becomes the standard in the academic world. In general, there is a growing understanding in the world that it makes sense to communicate with a computer a little more freely than at the click & drag program level. So, quite recently,
Medusa wrote that
not all programmers, virgins, programming should be studied by a much wider circle of people than has always been considered.
In this post I will talk about one of the shortest ways to programming - learning R with the help of the special
swirl package (the package in R is the same as in many other languages is called a library, extension / addition of the original functionality). The post is intended for a reader with zero knowledge of R who is interested in learning this programming language; it will help, as it seems to me, to make the first steps in the dark forest of programming as efficiently and painlessly as possible.
')
Why R?The short answer is : because only this I can share, I don’t know other programming languages.
Detailed answer : R is a universal tool that can be useful to a very wide range of specialists. This is a completely open and very dynamic project with a bunch of inspired followers around the world. Everyone can write their own package and put it in open access (it is really not very difficult). R provides endless possibilities for data visualization. To be inspired, you can look at one of the galleries (for example,
here or
here ). The possibilities of data analysis are endless. Only to pay attention to the most impressive, I suggest to look at
this post .
Habré has quite a lot of publications using R. There are also posts about the language itself, for example, the
R cheat sheet . Many curious things can be subtracted from the
text of the person who found R almost at the very beginning.
For a researcher, R is just a must.
So, you are still with me. So, without further ado, let's do a few simple steps to start active learning.
Attention!For training you will need a minimum knowledge of English. In general, we must get used to the fact that the computer prefers to do without the great and powerful.
Step 1. Installing RIt's simple. Go to the
official website , download under your axis, install. No complications. Cunning is, but about it in the following post.
Step 2. Install RStudioSimilarly. Go to the
official website , download under your axis, install. No complications at all.
What is RStudio?RStudio is ide (graphical shell) for R, probably the most common way to use R in general. This is a separate program that is built on R. There are, of course, hardcore progs who lose their peace of mind at the sight of the drawn gui button. But let's leave them alone: most users will not only like the RStudio interface, but will also make life easier. In addition, RStudio has some really unique advantages such as projects and support functions for creating packages. Well, okay ... Pros RStudio pull on a separate post. For now we’ll confine ourselves to installing the program.
The program is free for personal use. Without any restrictions. Companies for installation for commercial purposes will have to pay.
Step 3. Install the swirlAll you need is to write the following line in the console and press Enter
install.packages("swirl")
Some time in the console the installation process will be displayed. At the end, the program will report that all is well. Now you need to load the swirl. For this we use the function
library("swirl")
Everything! Interactive learning has begun.
If it's hard to just start writing commands like this ...... all the same can be done in RStudio using a convenient graphical interface.
In the lower right of the screen in Rstudio is a panel with supporting information. We are interested in the
Packages tab. Next, click the
Install button.

and the package installation dialog box appears. Enter the search
swirl and confirm the installation.

The installation process begins. It may take some time. Upon completion, the program will report on the successful installation, and the
swirl will appear in the list of packages.

If in RStudio to mark the necessary package in the list, it will be loaded in the current session. At the same time, the necessary function will be printed in the console itself.

Many simple operations in RStudio can be done using a graphical interface.
There are quite a few interactive courses designed for the swirl (in principle, no one bothers to develop your own). The list of official courses can be found on the
github developers page . The default rate is
R Programming . With him, and it makes sense to start everyone acquainted with R.
Additional courses are set by a special feature of the swirl package, for example
install_from_swirl('Regression_Models')
Swift learning!