March 2019
Beginner to intermediate
250 pages
6h 6m
English
You can create an object using the <- operator:
n<-10n## [1] 10
In the preceding code, an object called n is created. A value of 10 has been assigned to this object. The assignment can also be made using the assign() function, although this isn't very common.
Once the object has been created, it is possible to perform operations on it, like in any other programming language:
n+5## [1] 15
These are some examples of basic operations.
Let's create our variables:
x<-4y<-3
Now, we can carry out some basic operations:
x + y## [1] 7
x - y## [1] 1
x * y## [1] 12
x / y## [1] 1.333333
x ** y## [1] 64
Read now
Unlock full access