fibonacciPackage is an R package that provides a function to calculate the first N Fibonacci numbers.
First, install the devtools package, if you don't have it already:
$ R
> install.packages("devtools")You can install the development version of fibonacciPackage directly
from GitHub using the devtools package:
$ R
> library("devtools")
> devtools::install_github("deeplook/fibonacciPackage")Alternatively, you can clone the git repository or download a zip archive of it:
$ git clone https://github.com/deeplook/fibonacciPackage.gitNow without changing the folder, run R and install the package inside the folder:
$ R
> library("devtools")
> devtools::install("fibonacciPackage") # This is the package folder nameProgrammatic usage:
$ R
> library(fibonacciPackage)
> fibonacci_sequence(10)
[1] 1 1 2 3 5 8 13 21 34 55Command-line interface:
$ Rscript inst/scripts/fibonacci_cli.R 10
[1] 1 1 2 3 5 8 13 21 34 55
$ Rscript inst/scripts/fibonacci_cli.R --version
0.1.0$ Rscript fibonacciPackage/tests/testthat/test_fibonacci.R
Test passed 🌈
Test passed 😀$ R
> remove.packages("fibonacciPackage")