Skip to content

Commit

Permalink
fixing lintr + spelling issues, updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-machin committed Mar 7, 2024
1 parent 2aba852 commit c260eff
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# dfeR 0.1.1

Add default value to dp argument of round_five_up() function.
Add default value to decimal place argument of round_five_up() function.

# dfeR 0.1.0

Relaunch of the package with two functions:

- format_ay()
- round_five_up()
- format_ay()
- round_five_up()
4 changes: 2 additions & 2 deletions R/format_ay.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ format_ay <- function(year) {
#' @export
#' @examples
#' format_ay_reverse("2016/17")

format_ay_reverse <- function(year) {
if (!grepl("^\\d{4}/\\d{2}.*", year)) {
stop("year parameter must be a seven digit string in an academic year format, e.g. '2016/17'")
stop("year parameter must be a seven digit string in an academic
year format, e.g. '2016/17'")
}
gsub("/", "", year)
}
Expand Down
4 changes: 2 additions & 2 deletions R/format_fy.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ format_fy <- function(year) {
#' @export
#' @examples
#' format_fy_reverse("2016-17")

# function to reverse the change back to e.g. 201617
format_fy_reverse <- function(year) {
if (!grepl("^\\d{4}-\\d{2}.*", year)) {
stop("year parameter must be a seven digit string in a financial year format, e.g. '2016-17'")
stop("year parameter must be a seven digit string in a financial
year format, e.g. '2016-17'")
}
gsub("[^0-9A-Za-z///' ]", "", year)
}
2 changes: 1 addition & 1 deletion man/format_ay_reverse.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/format_fy_reverse.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c260eff

Please sign in to comment.