Commit 70392474 authored by Tom Reynkens's avatar Tom Reynkens

Change order of arguments

parent 3d716a5f
Type: Package
Package: smurf
Title: Sparse Multi-Type Regularized Feature Modeling
Version: 0.4.1.9001
Version: 0.4.1.9002
Date: 2018-09-25
Authors@R: c(
person("Tom", "Reynkens", email = "tomreynkens@hotmail.com", role = c("aut", "cre"),
......
......@@ -24,10 +24,10 @@
#' \item \code{"ggflasso"} (Graph-Guided Fused Lasso).
#' }
#' Default is \code{"lasso"}.
#' @param group Group to which the predictor belongs, only used for a Group Lasso penalty.
#' Default is \code{NULL} which means that predictor does not belong to a group.
#' @param refcat Reference level when \code{pred1} is a factor and \code{pen} is \code{"none"}, \code{"flasso"}, \code{"gflasso"}, or \code{"ggflasso"};
#' otherwise \code{refcat} is ignored. Default is \code{NULL} which means that the first level of \code{pred1} is used as the reference level (if \code{refcat} is not ignored).
#' @param group Group to which the predictor belongs, only used for a Group Lasso penalty.
#' Default is \code{NULL} which means that predictor does not belong to a group.
#' @details Predictors with no penalty, a Lasso penalty or a Group Lasso penalty should be numeric or a factor which can be non-numeric.
#' Predictors with a Fused Lasso, Generalized Fused Lasso, Graph-Guided Fused Lasso or 2D Fused Lasso penalty should be given as a factor
#' which can also be non-numeric. When a predictor is given as a factor, there cannot be any unused levels.
......@@ -54,7 +54,7 @@
#' @seealso \code{\link{glmsmurf}}
#'
#' @example /inst/Rent_example3.R
p <- function(pred1, pred2 = NULL, pen = "lasso", group = NULL, refcat = NULL) {
p <- function(pred1, pred2 = NULL, pen = "lasso", refcat = NULL, group = NULL) {
#######################
......@@ -201,7 +201,7 @@ p <- function(pred1, pred2 = NULL, pen = "lasso", group = NULL, refcat = NULL) {
# Add penalty and covariate name as attribute
attributes(x) <- c(attributes(x), list(penalty = pen, cov.name = cov.name, cov.names = cov.names,
group = group, refcat = refcat))
refcat = refcat, group = group))
return(x)
}
......@@ -4,7 +4,7 @@
\alias{p}
\title{Define Individual Subpenalties for a Multi-Type Regularized GLM}
\usage{
p(pred1, pred2 = NULL, pen = "lasso", group = NULL, refcat = NULL)
p(pred1, pred2 = NULL, pen = "lasso", refcat = NULL, group = NULL)
}
\arguments{
\item{pred1}{Name of the predictor used in the regularization term.}
......@@ -23,11 +23,11 @@ p(pred1, pred2 = NULL, pen = "lasso", group = NULL, refcat = NULL)
}
Default is \code{"lasso"}.}
\item{group}{Group to which the predictor belongs, only used for a Group Lasso penalty.
Default is \code{NULL} which means that predictor does not belong to a group.}
\item{refcat}{Reference level when \code{pred1} is a factor and \code{pen} is \code{"none"}, \code{"flasso"}, \code{"gflasso"}, or \code{"ggflasso"};
otherwise \code{refcat} is ignored. Default is \code{NULL} which means that the first level of \code{pred1} is used as the reference level (if \code{refcat} is not ignored).}
\item{group}{Group to which the predictor belongs, only used for a Group Lasso penalty.
Default is \code{NULL} which means that predictor does not belong to a group.}
}
\description{
Function used to define regularization terms in a \code{\link{glmsmurf}} model formula.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment