Complete the code to check if the variable x is numeric.
is_numeric <- is[1](x)The function is.numeric() checks if a variable is numeric in R.
Complete the code to convert the variable y to a character type.
y_char <- as[1](y)
The function as.character() converts a variable to character type in R.
Fix the error in the code to check if z is a logical type.
is_logical <- is[1](z)The correct function to check logical type is is.logical().
Fill both blanks to create a named vector with names as characters and values as numeric.
vec <- c([1] = 1, [2] = 2)
Vector names must be character strings, so use quotes around letters.
Fill all three blanks to create a list with a numeric, a character, and a logical element.
my_list <- list(num = [1], char = [2], logi = [3])
The list elements are numeric (42), character ("hello"), and logical (TRUE).
