diff --git a/NEWS.md b/NEWS.md index 74fba37..cb6ad3e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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() diff --git a/R/format_ay.R b/R/format_ay.R index 153949d..36db00d 100644 --- a/R/format_ay.R +++ b/R/format_ay.R @@ -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) } diff --git a/R/format_fy.R b/R/format_fy.R index b1ec49e..aabb7e2 100644 --- a/R/format_fy.R +++ b/R/format_fy.R @@ -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) } diff --git a/man/format_ay_reverse.Rd b/man/format_ay_reverse.Rd index 01786cd..19c0efd 100644 --- a/man/format_ay_reverse.Rd +++ b/man/format_ay_reverse.Rd @@ -10,7 +10,7 @@ format_ay_reverse(year) \item{year}{Academic year} } \value{ -Unformatted year +Unformatted 6 digit year as string } \description{ This function converts academic year variables back into 201617 format. diff --git a/man/format_fy_reverse.Rd b/man/format_fy_reverse.Rd index 61d90c1..736fe1c 100644 --- a/man/format_fy_reverse.Rd +++ b/man/format_fy_reverse.Rd @@ -10,7 +10,7 @@ format_fy_reverse(year) \item{year}{Financial year} } \value{ -Unformatted year +Unformatted 6 digit year as string } \description{ This function converts financial year variables back into 201617 format.