Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request branch #2

Merged
merged 20 commits into from Aug 13, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+7 −3
Diff settings

Always

Just for now

more linting

  • Loading branch information...
mailund committed Aug 13, 2016
commit b830efa64369d089debaf575870fc19ff8867307
Copy path View file
@@ -120,6 +120,10 @@ as.units.difftime = function(x, value) {
x
}

# Inside the group generic functions we do have .Generic even if the diagnostics
# think we do not.
# !diagnostics suppress=.Generic

#' Title
#'
#' @param e1 object of class \code{units},
@@ -145,7 +149,7 @@ Ops.units <- function(e1, e2) {

pw <- switch(.Generic, "**" = , "^" = TRUE, FALSE)

if (! eq && !prd && !pw)
if (!eq && !prd && !pw)
stop(paste("operation", .Generic, "not allowed"))

if (eq)
@@ -179,7 +183,7 @@ Ops.units <- function(e1, e2) {
#' cumsum(a)
#' signif(a, 2)
Math.units = function(x, ...) {
OK <- switch(.Generic, "abs" = , "sign" = , "floor" = , "ceiling" = , "log" =,
OK <- switch(.Generic, "abs" = , "sign" = , "floor" = , "ceiling" = , "log" = ,
"trunc" = , "round" = , "signif" = , "cumsum" = ,
"cummax" = , "cummin" = TRUE, FALSE)
if (!OK) {
@@ -251,7 +255,7 @@ print.units <- function(x, digits = getOption("digits"), ...)
}

#' @export
weighted.mean.units <- function (x, w, ...)
weighted.mean.units <- function(x, w, ...)
structure(weighted.mean(unclass(x), w, ...), units = attr(x,
"units"), class = "units")

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.