Write an R script with the following instructions: a. Compute the minimum, maximum, and average number of characters of a word in built-in words vector. b. Select two words randomly from the built-in words vector, print both words after converting the letters of the first one to upper case, and second one to title case. When you run your code, it should display two of the words randomly. c. Select 3 words randomly from the built-in words vector, concatenate them separated by a single space from shortest to longest. For instance, an output can be "view extra sunday".
Write an R script with the following instructions:
a. Compute the minimum, maximum, and average number of characters of a word
in built-in words vector.
b. Select two words randomly from the built-in words vector, print both words
after converting the letters of the first one to upper case, and second one to title case.
When you run your code, it should display two of the words randomly.
c. Select 3 words randomly from the built-in words vector, concatenate them
separated by a single space from shortest to longest. For instance, an output can be
"view extra sunday".
d. Print the last two letters of the words starting with ‘k’ in the built-in words
vector.
e. (5 pts) Print the shortest sentence in the built-in sentences vector. There are 2
sentences. You are expected to print both of them.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images