OneBite.Dev - Coding blog in a bite size

declare an integer in R

Code snippet on how to declare an integer in R

x <- 3

This code creates an integer variable called x with the value of 3. The ”<-” operator is used to assign a value to a variable, on the left side of the operator is the name of the variable, and on the right side is the value that the variable is assigned. In this case, the variable x is set to 3. The type of the variable is an integer, which is a whole number. Integers can be used for counting and ordering, but they do not allow for decimals or fractions.

r