I'm working on a coding project to define a function fbr(n,m) that takes integer vectors n and m as input, goes through all integers from n up to m for every element i, then returns a vector that for each number between n and m contains either a string "Fizz/Buzz/FizzBuzz" as defined by fizzbuzz(n) or the number itself.
I've already defined fizzbuzz as displayed below, but don't know where to start building the fbr(n,m) function
fizzbuzz <- function(n) {
for(i in length(n)){
if(n[i] %% 15 == 0){
print('Fizzbuzz')
} else if(n[i] %% 5 == 0){
print('Buzz')
} else if(n[i] %% 3 == 0){
print('Fizz')
} else {
print("")
}
}
}