https://github.com/deeplook/fibonaccipackage
Example R package to calculate Fibonacci numbers.
https://github.com/deeplook/fibonaccipackage
Last synced: 12 months ago
JSON representation
Example R package to calculate Fibonacci numbers.
- Host: GitHub
- URL: https://github.com/deeplook/fibonaccipackage
- Owner: deeplook
- License: mit
- Created: 2024-07-12T13:20:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-03T22:18:39.000Z (almost 2 years ago)
- Last Synced: 2025-03-16T19:25:50.728Z (over 1 year ago)
- Language: R
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fibonacciPackage
## Description
fibonacciPackage is an R package that provides a function to calculate
the first N Fibonacci numbers.
## Installation
First, install the `devtools` package, if you don't have it already:
```R
$ R
> install.packages("devtools")
```
### From GitHub
You can install the development version of fibonacciPackage directly
from GitHub using the `devtools` package:
```R
$ R
> library("devtools")
> devtools::install_github("deeplook/fibonacciPackage")
```
### From local folder
Alternatively, you can clone the git repository or download a zip
archive of it:
```console
$ git clone https://github.com/deeplook/fibonacciPackage.git
```
Now without changing the folder, run R and install the package inside
the folder:
```R
$ R
> library("devtools")
> devtools::install("fibonacciPackage") # This is the package folder name
```
## Usage
Programmatic usage:
```R
$ R
> library(fibonacciPackage)
> fibonacci_sequence(10)
[1] 1 1 2 3 5 8 13 21 34 55
```
Command-line interface:
```console
$ 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
```
## Testing
```console
$ Rscript fibonacciPackage/tests/testthat/test_fibonacci.R
Test passed 🌈
Test passed 😀
```
## Uninstallation
```R
$ R
> remove.packages("fibonacciPackage")
```