Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 18, 2023
1 parent 6c9c4ad commit 20fe798
Showing 1 changed file with 54 additions and 54 deletions.
108 changes: 54 additions & 54 deletions R/find_algorithm.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,31 @@ find_algorithm.default <- function(x, ...) {

#' @export
find_algorithm.Gam <- function(x, ...) {
list("algorithm" = "IWLS")
list(algorithm = "IWLS")
}


#' @export
find_algorithm.lmRob <- function(x, ...) {
list("algorithm" = x$robust.control$final.alg)
list(algorithm = x$robust.control$final.alg)
}


#' @export
find_algorithm.lmrob <- function(x, ...) {
list("algorithm" = x$control$method)
list(algorithm = x$control$method)
}


#' @export
find_algorithm.glmrob <- function(x, ...) {
list("algorithm" = x$method)
list(algorithm = x$method)
}


#' @export
find_algorithm.logistf <- function(x, ...) {
list("algorithm" = x$method)
list(algorithm = x$method)
}

#' @export
Expand All @@ -90,25 +90,25 @@ find_algorithm.flic <- find_algorithm.logistf

#' @export
find_algorithm.bigglm <- function(x, ...) {
list("algorithm" = "ML")
list(algorithm = "ML")
}


#' @export
find_algorithm.BBreg <- function(x, ...) {
list("algorithm" = "ML")
list(algorithm = "ML")
}


#' @export
find_algorithm.Arima <- function(x, ...) {
list("algorithm" = "ML")
list(algorithm = "ML")
}


#' @export
find_algorithm.glimML <- function(x, ...) {
list("algorithm" = "ML")
list(algorithm = "ML")
}


Expand All @@ -122,21 +122,21 @@ find_algorithm.BBmm <- function(x, ...) {

#' @export
find_algorithm.biglm <- function(x, ...) {
list("algorithm" = "OLS")
list(algorithm = "OLS")
}


#' @export
find_algorithm.gamlss <- function(x, ...) {
list("algorithm" = as.character(x$method)[1])
list(algorithm = as.character(x$method)[1])
}


#' @export
find_algorithm.gam <- function(x, ...) {
list(
"algorithm" = x$method,
"optimizer" = x$optimizer
algorithm = x$method,
optimizer = x$optimizer
)
}

Expand All @@ -146,25 +146,25 @@ find_algorithm.scam <- find_algorithm.gam

#' @export
find_algorithm.lm <- function(x, ...) {
list("algorithm" = "OLS")
list(algorithm = "OLS")
}


#' @export
find_algorithm.systemfit <- function(x, ...) {
list("algorithm" = x$method)
list(algorithm = x$method)
}


#' @export
find_algorithm.afex_aov <- function(x, ...) {
list("algorithm" = "OLS")
list(algorithm = "OLS")
}


#' @export
find_algorithm.speedlm <- function(x, ...) {
list("algorithm" = x$method)
list(algorithm = x$method)
}


Expand All @@ -174,62 +174,62 @@ find_algorithm.blavaan <- function(x, ...) {
check_if_installed("blavaan")

list(
"chains" = blavaan::blavInspect(x, "n.chains"),
"sample" = x@external$sample,
"warmup" = x@external$burnin
chains = blavaan::blavInspect(x, "n.chains"),
sample = x@external$sample,
warmup = x@external$burnin
)
}


#' @export
find_algorithm.speedglm <- function(x, ...) {
list("algorithm" = x$method)
list(algorithm = x$method)
}


#' @export
find_algorithm.rq <- function(x, ...) {
list("algorithm" = x$method)
list(algorithm = x$method)
}


#' @export
find_algorithm.bayesx <- function(x, ...) {
list(
"algorithm" = x$method,
"iterations" = x$iterations,
"warmup" = x$burnin
algorithm = x$method,
iterations = x$iterations,
warmup = x$burnin
)
}


#' @export
find_algorithm.crq <- function(x, ...) {
list("algorithm" = x$method)
list(algorithm = x$method)
}


#' @export
find_algorithm.rqss <- function(x, ...) {
list("algorithm" = x$method)
list(algorithm = x$method)
}


#' @export
find_algorithm.glm <- function(x, ...) {
list("algorithm" = "ML")
list(algorithm = "ML")
}


#' @export
find_algorithm.nestedLogit <- function(x, ...) {
list("algorithm" = "ML")
list(algorithm = "ML")
}


#' @export
find_algorithm.LORgee <- function(x, ...) {
list("algorithm" = "Fisher's scoring ML")
list(algorithm = "Fisher's scoring ML")
}


Expand All @@ -238,8 +238,8 @@ find_algorithm.merMod <- function(x, ...) {
algorithm <- ifelse(as.logical(x@devcomp$dims[["REML"]]), "REML", "ML")

list(
"algorithm" = algorithm,
"optimizer" = as.character(x@optinfo$optimizer)
algorithm = algorithm,
optimizer = as.character(x@optinfo$optimizer)
)
}

Expand All @@ -258,8 +258,8 @@ find_algorithm.mixed <- function(x, ...) {
algorithm <- ifelse(as.logical(x@devcomp$dims[["REML"]]), "REML", "ML")

list(
"algorithm" = algorithm,
"optimizer" = as.character(x@optinfo$optimizer)
algorithm = algorithm,
optimizer = as.character(x@optinfo$optimizer)
)
}

Expand All @@ -272,8 +272,8 @@ find_algorithm.lme <- function(x, ...) {
}

list(
"algorithm" = x$method,
"optimizer" = optimizer
algorithm = x$method,
optimizer = optimizer
)
}

Expand All @@ -282,8 +282,8 @@ find_algorithm.lme <- function(x, ...) {
find_algorithm.MixMod <- function(x, ...) {
list(
## FIXME
"algorithm" = "quasi-Newton",
"optimizer" = x$control$optimizer
algorithm = "quasi-Newton",
optimizer = x$control$optimizer
)
}

Expand All @@ -293,8 +293,8 @@ find_algorithm.glmmTMB <- function(x, ...) {
algorithm <- ifelse(x$modelInfo$REML, "REML", "ML")

list(
"algorithm" = algorithm,
"optimizer" = "nlminb"
algorithm = algorithm,
optimizer = "nlminb"
)
}

Expand All @@ -304,10 +304,10 @@ find_algorithm.stanreg <- function(x, ...) {
info <- x$stanfit@sim

list(
"algorithm" = x$algorithm,
"chains" = info$chains,
"iterations" = info$iter,
"warmup" = info$warmup
algorithm = x$algorithm,
chains = info$chains,
iterations = info$iter,
warmup = info$warmup
)
}

Expand All @@ -318,19 +318,19 @@ find_algorithm.stanfit <- function(x, ...) {
algorithm <- unlist(x@stan_args)

list(
"algorithm" = as.vector(algorithm["algorithm"]),
"chains" = info$chains,
"iterations" = info$iter,
"warmup" = info$warmup
algorithm = as.vector(algorithm["algorithm"]),
chains = info$chains,
iterations = info$iter,
warmup = info$warmup
)
}


#' @export
find_algorithm.bayesQR <- function(x, ...) {
list(
"algorithm" = x[[1]]$method,
"iterations" = nrow(x[[1]]$betadraw)
algorithm = x[[1]]$method,
iterations = nrow(x[[1]]$betadraw)
)
}

Expand All @@ -340,9 +340,9 @@ find_algorithm.brmsfit <- function(x, ...) {
info <- x$fit@sim

list(
"algorithm" = x$algorithm,
"chains" = info$chains,
"iterations" = info$iter,
"warmup" = info$warmup
algorithm = x$algorithm,
chains = info$chains,
iterations = info$iter,
warmup = info$warmup
)
}

0 comments on commit 20fe798

Please sign in to comment.