Skip to content

Commit

Permalink
added test and vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
tmss1 committed Jul 5, 2022
1 parent 0790a5f commit d04c59b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.Rhistory
.RData
.Ruserdata
inst/doc
4 changes: 4 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ Description: More about what it does (maybe more than one line)
License: What license is it under?
Encoding: UTF-8
LazyData: true
Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
3 changes: 3 additions & 0 deletions inst/tests/tests.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test make_filename
testthat::expect_equal(make_filename(2015),"accident_2015.csv.bz2")

2 changes: 2 additions & 0 deletions vignettes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.html
*.R
23 changes: 23 additions & 0 deletions vignettes/make_filename.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "make_filename"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{make_filename}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

The `make_filename` function creates an "accident_year.csv.bz2" file name given the year entered by the user.

```{r setup}
library(fars)
fname <- make_filename(2015)
fname
```

0 comments on commit d04c59b

Please sign in to comment.