Answered step by step
Verified Expert Solution
Question
1 Approved Answer
# Write a function ` has _ more _ zs ` to determine which of two strings contains # more instances of the letter
# Write a function hasmorezs to determine which of two strings contains
# more instances of the letter z It should take as parameters two string
# variables, and return the argument which has more occurances of the letter z
# If neither phrase contains the letter z it should return:
# "Neither string contains the letter z
# If the phrases contain the same number of zs it should return:
# "The strings have the same number of Zs
# The function must work for both capital and lowercase zs
#
# hint: try googling "stringr count occurances"
# Create a variable morezs by passing two strings of your choice to your
# hasmorezs function
# Write a function removedigits that will remove all digits
# ie through from all elements in a vector of strings
# Demonstrate that your approach is successful by passing a vector of courses
# to your function. For example, removedigitscINFO "CSE
# Vectors
# Create a vector movies that contains the names of six movies you like
# Create a vector topthree that only contains the first three movies
# You should do this by subsetting the vector, not by simply retyping the movies
# Using your vector and the paste method, create a vector excited that
# adds the phrase is a great movie!" to the end of each element movies
# Create a vector withoutfour by omitting the fourth element from movies
# You should do this using a negative index
# Create a vector multiplesof that is every number divisible by
# between and pointshint google r mod divisible"
# Create a vector multiplesof by filtering your multiplesof variable
# down to only elements that are divisible by
# Create a vector numbers that is the numbers through
# Using the built in length function, create a variable numberslen
# that is equal to the length of your vector numbers
# Using the mean function, create a variable numbersmean that is
# equal to the mean of your vector numbers
# Using the median function, create a variable numbersmedian
# that is the median of your vector numbers
# Create a vector lowernumbers that the values in your numbers vector
# that are lower than numbersmeanyou should do this using vector filtering
# Create a vector highernumbers that the values in your numbers vector
# that are higher than numbersmeanagain using vector filtering
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started