fizzbuzz: Fizzbuzz function

Description Usage Arguments Details Examples

View source: R/fizzbuzz.R

Description

Function implementing the fizzbuzz function.

The function takes a vector of numbers as inputs and replaces values that are evenly divisible by 3 with "Fizz", values that are evenly divisible by 5 with "Buzz", and values evenly divisible by both with "FizzBuzz".

Usage

1

Arguments

x

A numeric vector

Details

The input vector is expected to be numeric and contain only finite values, that are greater than or equal to 0 and must be representable as an integer. Any violations of these assumptions will result in an error.

Examples

1
2
3
4
5
6
7
8
fizzbuzz(1:3)
fizzbuzz(10:1)

## Not run: 
# The following will throw an error
fizzbuzz(-1)

## End(Not run)

Sta523-Fa21/fizzbuzz documentation built on Dec. 18, 2021, 2:08 p.m.