--1-A quick refresher
#Using the function template, write a function ratio()
#that takes arguments x and y and returns their ratio, x / y.
#Check your function by calling it with the arguments 3 and 4.
# Define ratio() function
ratio <- function(x, y) {
cevi= x/y
return(cevi)
}
# Call ratio() with arguments 3 and 4
ratio(3,4)#Here's a rather cryptic call to mean().
#Rewrite the call to follow the best practices we just discussed.
#Use the natural ordering of the arguments,
#which you can find by typing ?mean in the console.
# Rewrite the call to follow best practices
mean(c(1:9, NA), trim = 0.1, na.rm = TRUE)Last updated