Skip to content

Commit

Permalink
Remove a dplyr dependency from a function
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyEbert committed Sep 4, 2018
1 parent f57d576 commit 4e32971
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/dplyr_plugins.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ queue_lengths <- function(arrivals, service = 0, departures, epsilon = 1e-10, ..
#' average_queue(queuedata$times, queuedata$queuelength)
#' @export
average_queue <- function(times, queuelength){
((c(diff(times),0) %*% queuelength) / (times[length(times)] - times[1])) %>% as.numeric()
as.numeric((c(diff(times),0) %*% queuelength) / (times[length(times)] - times[1]))
}

#' Summarise queue lengths
Expand Down

0 comments on commit 4e32971

Please sign in to comment.