Variables and expressions in R

Variables and expressions in R are treated in a modern and efficient way, in fact while in most programming languages ​​a declaration of the variables used in the program is required, declaration made in the initial part before the executive section of the same, in R all this is not required. Because language does not require the declaration of variables; the type and its size will be decided when they are initialized.

The term variable refers to a type of data whose value is variable during the execution of the program. However, it is possible to assign an initial value to it, so we will talk about initializing the variable. The initialization phase assumes a fundamental importance because it represents the moment in which the variable is created, this moment coincides with that in which a given value is associated with it.

Unlike the so-called compilation languages, this procedure can be inserted anywhere in the script, even if the meanings can take different values.

When the interpreter encounters a variable, it deposits the relative value in a memory location and whenever a call to that variable appears in the program, it will refer to this location. It is a good planning rule to use names that will allow us to refer unambiguously to specific memory locations where the relevant data has been stored.

Leave a Reply

Your email address will not be published. Required fields are marked *