Complete the code to find the number of elements in the vector v.
len <- [1](v)The length() function returns the number of elements in a vector.
Complete the code to calculate the total sum of the vector v.
total <- [1](v)The sum() function adds all the numbers in the vector together.
Fix the error in the code to calculate the average of vector v.
avg <- [1](v)The mean() function calculates the average value of the vector.
Fill both blanks to create a vector with word lengths greater than 3.
lengths <- [1](words[[2](words) > 3])
The nchar() function returns the number of characters in a word. We use it to get length and to compare if length is greater than 3.
Fill all three blanks to create uppercase words with character count greater than 4.
result <- [1](words[[2](words) [3] 4])
toupper() converts words to uppercase, nchar() counts characters, and > checks if greater than 4.