It seems that the
Python language is enough for everything: to write a script for the server,
analyze the data, and train the neural network. Moreover, there are many
libraries for statistics and data analysis for it – you can take and use any of
But often, another
language is used for analytics and work with statistics – R. However, if you
want to get a job in a big tech company and not just work with data science,
then it is better to choose not R, but C++ for study. This language may seem a
lot more difficult to you, but the good news is that you can always get help
with your C++ homework. Thus, you will not get stuck on one task for
a long time and will be able to quickly work through difficult points in the
Let’s find out how to
start your R assignments.
To make working with
data even easier, the community of scientists and developers made many
different modules, each for its own task (they are also called packages). Among
them, there are also basic modules, without which it will not work in R: the
base module or the grDevices module, which is responsible for displaying graphs
on the screen.
If you need something
specialized for working with data, most likely, there is already a module for
this. For example, for cluster analysis, the cluster module is connected, and
the nlme module is used to analyze nonlinear models. Now there are about two
thousand modules available, so, most likely, a ready-made module can be found
for each assignment.
variables and vectors
To declare a variable, it is enough to declare its name
and assign something to it, and R itself will figure out what type is needed
here. More precisely, there are many data structures in R: vectors, matrices, lists, factors, and so
on. The most important is the vector – it is a set of elements that have the
same data type.
of vectors themselves are:
vectors, you can do any operations from vector algebra.
out how input and output work
the value of a variable, you just need to write its name. And to output the message, you
need the print (): print command. If you need to output a graph of a function,
you can use the standard plot () command – it will plot a graph in the form of
points, histograms or connect everything with lines.
Since R is
designed to work with large amounts of data, data is input not from the
keyboard but from files. But if you need keyboard input, use the readline ()
assignment and comparison
is denoted, as usual, double sign equals.
But there are two assignments, an arrow, and an equal sign. If not to go into
the nuances of use, then the arrow is responsible for the global use of the
variable so that it is visible to everyone, and the equal sign is for local
use, that is, inside some subroutine.