These files contain all the code we created to populate the mypackage package.
Your Files should contain:
hello.R
R/hello.R
#' Hello World!#'#' Print personalised hello greeting from me.#'#' @param name character string. Your name!#'#' @return prints hello greeting to console#' @export#'#' @examples#' hello()#' hello("Lucy Elen")hello<-function(name=NULL){# create greetingif(is.null(name)){name<-"world"}greeting<-paste("Hello", name, "from Anna!")# randomly sample an animalanimal<-sample(cowsay::animals, 1)cowsay::say(greeting, by =animal)}
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# mypackage
<!-- badges: start -->
[](https://github.com/annakrystalli/mypackage/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The goal of mypackage is to print a personalised greeting from me!
## Installation
You can install the development version of mypackage from GitHub with:
``` r
# install.packages("remotes")
remotes::install_github("annakrystalli/mypackage")
```
## Example
This is a basic example which shows you how to print a generic greeting:
```{r example}
library(mypackage)
## basic example code
hello()
```
This is a basic example which shows you how to print a personalised greeting:
```{r}
hello(name = "Lucy Elen")
```
DESCRIPTION
DESCRIPTION
Package: mypackageTitle: Customised greetings from me!Version:0.0.0.9000Authors@R:person("Anna", "Krystalli", email ="annakrystalli@googlemail.com", role =c("aut", "cre"))Description: Prints a customised greeting from myself, delivered by a friend.License: MIT + file LICENSEEncoding: UTF-8Roxygen:list(markdown =TRUE)RoxygenNote:7.3.3Imports: cowsaySuggests:testthat (>=3.0.0)Config/testthat/edition:3Date:2026-05-01URL: https://github.com/annakrystalli/mypackageBugReports: https://github.com/annakrystalli/mypackage/issues