Skip to content

Commit

Permalink
Merge pull request #157 from brews/quick_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brews committed Aug 7, 2019
2 parents 56b3ebd + ce68976 commit f2ca428
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 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
12 changes: 6 additions & 6 deletions R/sea.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
#'
#' @return A `sea` object containing. This contains:
#' * "event_years": a numeric vector of event years.
#' * "actual": a `data.frame` summary of the actual events composite.
#' * "simulated": a `data.frame` summary of the simulated events composite.
#' * "departure": a `data.frame` summary of the departures of "actual" from
#' "simulated" events.
#' * "simulated": a 2D `matrix` of the bootstrapped-values across lags.
#' * "observed": a 2D `matrix` of "actual" events and their lags.
#' * "actual": a `data.frame` summary of the actual events.
#' * "random": a `data.frame` summary of the bootstrapped events.
#' * "departure": a `data.frame` summary of the departures of actual from
#' bootstrapped events.
#' * "simulated": a full 2D `matrix` of the bootstrapped-values across lags.
#' * "observed": a ful 2D `matrix` of "actual" events across lags.
#'
#' @seealso
#' * [plot_sealags()] plots `sea` lags and their statistical significance.
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
12 changes: 6 additions & 6 deletions man/sea.Rd

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

0 comments on commit f2ca428

Please sign in to comment.