Core essentials of R programming
One of the reasons for R's success is its use of variables. Variables are used in all aspects of R programming. For example, variables can hold data, strings to access a database, whole models, queries, and test results. Variables are a key part of the modeling process, and their selection has a fundamental impact on the usefulness of the models. Therefore, variables are an important place to start since they are at the heart of R programming.
Variables
In the following section we will deal with the variables—how to create variables and working with variables.
Creating variables
It is very simple to create variables in R, and to save values in them. To create a variable, you simply need to give the variable a name, and assign a value to it.
In many other languages, such as SQL, it's necessary to specify the type of value that the variable will hold. So, for example, if the variable is designed to hold an integer or a string, then this is specified at the point...