Basic data types in R

R Programming Language Data Types in R Language (Article) Data Types in R Language (Program)

344

Program:

<span class="com"># Change my_numeric to be 42</span><span class="pln">
my_numeric </span><span class="pun">&lt;-</span><span class="pln"> </span><span class="lit">42.5</span><span class="pln">

</span><span class="com"># Change my_character to be "universe"</span><span class="pln">
my_character </span><span class="pun">&lt;-</span><span class="pln"> </span><span class="str">"some text"</span><span class="pln">

</span><span class="com"># Change my_logical to be FALSE</span><span class="pln">
my_logical </span><span class="pun">&lt;-</span><span class="pln"> TRUE</span>

Output:

> # Change my_numeric to be 42
> my_numeric <- 42
> 
> # Change my_character to be "universe"
> my_character <- "universe"
> 
> # Change my_logical to be FALSE
> my_logical <- FALSE

Explanation:

Change the value of the: my_numeric variable to 42. my_character variable to "universe". Note that the quotation marks indicate that "universe" is a character. my_logical variable to FALSE. Note that R is case sensitive!

This Particular section is dedicated to Programs only. If you want learn more about R Programming Language. Then you can visit below links to get more depth on this subject.