Skip to content

Commit

Permalink
yearly_recording doest return factors, close #154
Browse files Browse the repository at this point in the history
  • Loading branch information
brews committed Aug 7, 2019
1 parent 848240f commit ce68976
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Changes in this release:

* Updated in-package citation information (`citation("burnr")`). Please cite burnr if you use it in your work!

* `yearly_recording()` now returns a data frame with a numeric "year" column (Issue #154). In past versions, the "year" column contained factors.

* Added unit tests for basic plotting function options. We now have test coverage for more than 75% of our code.

* Minor internal code cleanup (Issue #130, Issue #88, Issue #133, Issue #136, Issue #88, Issue #146) and code linting.
Expand Down
14 changes: 10 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,16 @@ count_event_position <- function(x, injury_event = FALSE, position, groupby) {
#'
#' @export
yearly_recording <- function(x, injury_event = FALSE) {
as.data.frame(table(year = plyr::ddply(x, "series",
find_recording,
injury_event = injury_event
)$recording))
out <- as.data.frame(
table(
year = plyr::ddply(x, "series", find_recording,
injury_event = injury_event
)$recording
),
stringsAsFactors=FALSE
)
out$year <- as.numeric(out$year)
out
}


Expand Down

0 comments on commit ce68976

Please sign in to comment.