A friendly R package that provides greeting and farewell functions in multiple languages.
Installation
You can install the development version of myrpackage from GitHub with:
# install.packages("devtools")
devtools::install_github("DiogoRibeiro7/myrpackage")
Usage
Basic Examples
library(myrpackage)
# Say hello with default parameters
hello()
#> Hello, world!
# Say hello to someone specific
hello("R Users")
#> Hello, R Users!
# Say hello in different languages
hello("amigos", language = "spanish")
#> Hola, amigos!
hello("mes amis", language = "french")
#> Bonjour, mes amis!
# Say hello with capitalization
hello("r users", capitalize = TRUE)
#> Hello, R users!
# Say goodbye
goodbye()
#> Goodbye, world!
goodbye("friends", language = "portuguese")
#> Adeus, friends!
# Customize punctuation
goodbye("everyone", exclamation = FALSE)
#> Goodbye, everyone.
Features
- π Multilingual greeting and farewell functions in 6 languages
- π Text formatting options including capitalization
- π¦ Proper R package structure
- π Comprehensive documentation
- π§ͺ Complete test coverage
- π Continuous Integration workflow
Function Options
Both hello()
and goodbye()
support these parameters:
-
name
: Who to greet (default: βworldβ) -
language
: Language to use (default: βenglishβ) -
exclamation
: Whether to add an exclamation mark (default: TRUE) -
capitalize
: Whether to capitalize the name (default: FALSE)
Package Structure
myrpackage/
βββ DESCRIPTION # Package metadata
βββ NAMESPACE # Exported functions
βββ R/ # R source code
β βββ hello.R # Hello function
β βββ goodbye.R # Goodbye function
β βββ utils.R # Utility functions
β βββ lifecycle.R # Lifecycle definitions
β βββ myrpackage-package.R # Package documentation
βββ man/ # Documentation
βββ tests/ # Tests
β βββ testthat/ # Unit tests
βββ vignettes/ # Long-form documentation
β βββ intro.Rmd # Introduction vignette
β βββ advanced.Rmd # Advanced usage vignette
βββ inst/ # Installed files
β βββ CITATION # Citation information
βββ LICENSE # MIT license
Development
Getting Started
- Clone the repository
- Open the project in RStudio or your preferred R environment
- Install development dependencies with
devtools::install_dev_deps()
Running Tests
# Run tests
devtools::test()
# Check test coverage
covr::package_coverage()
Building Documentation
# Generate documentation
devtools::document()
# Build vignettes
devtools::build_vignettes()
# Preview package website
pkgdown::build_site()
Quality Checks
# Run R CMD check
devtools::check()
# Check package with more stringent CRAN checks
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"))
# Lint code
lintr::lint_package()
# Style code
styler::style_pkg()
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.