Complete the code to create an integer variable with value 10.
x <- [1]In R, adding L after a number makes it an integer literal.
Complete the code to check if variable y is of integer type.
is.integer([1])The function is.integer() checks the type of the variable passed to it.
Fix the error in the code to convert a numeric value to integer.
z <- [1](5.7)
as.character() converts to string, not integer.as.logical() converts to TRUE/FALSE, not integer.Use as.integer() to convert numeric values to integers in R.
Fill both blanks to create a vector of integers from 1 to 5 and check its type.
vec <- [1](1:5) is_int <- [2](vec)
as.numeric instead of as.integer.is.numeric instead of is.integer.as.integer() converts the sequence to integers, and is.integer() checks if the vector is integer type.
Fill all three blanks to create an integer vector, convert a number to integer, and check if it is integer.
int_vec <- [1](c(2.5, 3.7, 4.1)) num <- [2](5.9) check <- [3](num)
as.numeric() instead of as.integer().is.numeric() instead of is.integer().Use as.integer() to convert values to integers and is.integer() to check the type.
