Complete the code to convert a list to a vector using unlist().
my_list <- list(1, 2, 3) my_vector <- [1](my_list)
The unlist() function converts a list to a vector by flattening it.
Complete the code to convert a list of characters to a vector.
char_list <- list('a', 'b', 'c') char_vector <- [1](char_list)
unlist() converts the list of characters into a character vector.
Fix the error in converting a nested list to a vector.
nested_list <- list(1, list(2, 3)) flat_vector <- [1](nested_list)
unlist() correctly flattens nested lists into a vector.
Fill both blanks to create a numeric vector from a list and check its type.
num_list <- list(4, 5, 6) num_vector <- [1](num_list) is_numeric <- is.[2](num_vector)
unlist() converts the list to a vector, and is.numeric() checks if it is numeric.
Fill all three blanks to convert a list to a vector, filter values greater than 2, and get the length.
values <- list(1, 3, 5, 2) vec <- [1](values) filtered <- vec[vec [2] 2] count <- length([3])
unlist() converts the list to a vector, then we filter values greater than 2, and finally get the length of the filtered vector.