Skip to content

Commit

Permalink
Remove links argument #214
Browse files Browse the repository at this point in the history
  • Loading branch information
venpopov committed May 22, 2024
1 parent 6e64234 commit 196bbd0
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 74 deletions.
29 changes: 12 additions & 17 deletions R/model_imm.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.model_imm <-
function(resp_error = NULL, nt_features = NULL, nt_distances = NULL,
set_size = NULL, regex = FALSE, links = NULL, version = "full",
set_size = NULL, regex = FALSE, version = "full", links = NULL,
call = NULL, ...) {
out <- structure(
list(
Expand Down Expand Up @@ -116,8 +116,6 @@
#' @param regex Logical. If TRUE, the `nt_features` and `nt_distances` arguments
#' are interpreted as a regular expression to match the non-target feature
#' columns in the dataset.
#' @param links A list of links for the parameters. *Currently does not affect
#' the model fits, but it will in the future.*
#' @param version Character. The version of the IMM model to use. Can be one of
#' `full`, `bsc`, or `abc`. The default is `full`.
#' @param ... used internally for testing, ignore it
Expand Down Expand Up @@ -178,8 +176,7 @@
#' backend = 'cmdstanr')
#'}
#' @export
imm <- function(resp_error, nt_features, nt_distances, set_size, regex = FALSE,
links = NULL, version = "full", ...) {
imm <- function(resp_error, nt_features, nt_distances, set_size, regex = FALSE, version = "full", ...) {
call <- match.call()
dots <- list(...)
if ("setsize" %in% names(dots)) {
Expand All @@ -192,7 +189,7 @@ imm <- function(resp_error, nt_features, nt_distances, set_size, regex = FALSE,
stop_missing_args()
.model_imm(resp_error = resp_error, nt_features = nt_features,
nt_distances = nt_distances, set_size = set_size, regex = regex,
links = links, version = version, call = call, ...)
version = version, call = call, ...)
}


Expand All @@ -201,8 +198,7 @@ imm <- function(resp_error, nt_features, nt_distances, set_size, regex = FALSE,
#' @rdname imm
#' @keywords bmmodel
#' @export
IMMfull <- function(resp_error, nt_features, nt_distances, set_size, regex = FALSE,
links = NULL, ...) {
IMMfull <- function(resp_error, nt_features, nt_distances, set_size, regex = FALSE, ...) {
call <- match.call()
dots <- list(...)
warning("The function `IMMfull()` is deprecated. Please use `imm(version = 'full')` instead.")
Expand All @@ -213,15 +209,14 @@ IMMfull <- function(resp_error, nt_features, nt_distances, set_size, regex = FAL
stop_missing_args()
.model_imm(resp_error = resp_error, nt_features = nt_features,
nt_distances = nt_distances, set_size = set_size, regex = regex,
links = links, version = "full", call = call, ...)
version = "full", call = call, ...)
}


#' @rdname imm
#' @keywords bmmodel
#' @export
IMMbsc <- function(resp_error, nt_features, nt_distances, set_size, regex = FALSE,
links = NULL, ...) {
IMMbsc <- function(resp_error, nt_features, nt_distances, set_size, regex = FALSE, ...) {
call <- match.call()
dots <- list(...)
warning("The function `IMMbsc()` is deprecated. Please use `imm(version = 'bsc')` instead.")
Expand All @@ -232,14 +227,13 @@ IMMbsc <- function(resp_error, nt_features, nt_distances, set_size, regex = FALS
stop_missing_args()
.model_imm(resp_error = resp_error, nt_features = nt_features,
nt_distances = nt_distances, set_size = set_size, regex = regex,
links = links, version = "bsc", call = call, ...)
version = "bsc", call = call, ...)
}

#' @rdname imm
#' @keywords bmmodel
#' @export
IMMabc <- function(resp_error, nt_features, set_size, regex = FALSE, links = NULL,
...) {
IMMabc <- function(resp_error, nt_features, set_size, regex = FALSE, ...) {
call <- match.call()
dots <- list(...)
warning("The function `IMMabc()` is deprecated. Please use `imm(version = 'abc')` instead.")
Expand All @@ -248,9 +242,10 @@ IMMabc <- function(resp_error, nt_features, set_size, regex = FALSE, links = NUL
warning("The argument 'setsize' is deprecated. Please use 'set_size' instead.")
}
stop_missing_args()
.model_imm(resp_error = resp_error, nt_features = nt_features,
set_size = set_size, regex = regex, links = links,
version = "abc", call = call, ...)
.model_imm(
resp_error = resp_error, nt_features = nt_features, set_size = set_size,
regex = regex, version = "abc", call = call, ...
)
}

#############################################################################!
Expand Down
6 changes: 2 additions & 4 deletions R/model_mixture2p.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
#' the response error. The response Error should code the response relative to
#' the to-be-recalled target in radians. You can transform the response error
#' in degrees to radian using the `deg2rad` function.
#' @param links A list of links for the parameters. *Currently does not affect
#' the model fits, but it will in the future.*
#' @param ... used internally for testing, ignore it
#' @return An object of class `bmmodel`
#' @keywords bmmodel
Expand All @@ -79,10 +77,10 @@
#' backend = 'cmdstanr')
#' }
#' @export
mixture2p <- function(resp_error, links = NULL, ...) {
mixture2p <- function(resp_error, ...) {
call <- match.call()
stop_missing_args()
.model_mixture2p(resp_error = resp_error, links = links, call = call, ...)
.model_mixture2p(resp_error = resp_error, call = call, ...)
}

#############################################################################!
Expand Down
10 changes: 3 additions & 7 deletions R/model_mixture3p.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

out <- structure(
list(
resp_vars = nlist(resp_error),
resp_vars = nlist(resp_error),
other_vars = nlist(nt_features, set_size),
domain = "Visual working memory",
task = "Continuous reproduction",
Expand Down Expand Up @@ -76,8 +76,6 @@
#' fixed.
#' @param regex Logical. If TRUE, the `nt_features` argument is interpreted as
#' a regular expression to match the non-target feature columns in the dataset.
#' @param links A list of links for the parameters. *Currently does not affect
#' the model fits, but it will in the future.*
#' @param ... used internally for testing, ignore it
#' @return An object of class `bmmodel`
#' @keywords bmmodel
Expand Down Expand Up @@ -122,8 +120,7 @@
#' iter = 500,
#' backend = 'cmdstanr')
#' }
mixture3p <- function(resp_error, nt_features, set_size, regex = FALSE,
links = NULL, ...) {
mixture3p <- function(resp_error, nt_features, set_size, regex = FALSE, ...) {
call <- match.call()
dots <- list(...)
if ("setsize" %in% names(dots)) {
Expand All @@ -132,8 +129,7 @@ mixture3p <- function(resp_error, nt_features, set_size, regex = FALSE,
}
stop_missing_args()
.model_mixture3p(resp_error = resp_error, nt_features = nt_features,
set_size = set_size, regex = regex, links = links,
call = call, ...)
set_size = set_size, regex = regex, call = call, ...)
}

#############################################################################!
Expand Down
10 changes: 4 additions & 6 deletions R/model_sdm.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
#' response error. The response error should code the response relative to the
#' to-be-recalled target in radians. You can transform the response error in
#' degrees to radians using the `deg2rad` function.
#' @param links A list of links for the parameters. *Currently does not affect
#' the model fits, but it will in the future.*
#' @param version Character. The version of the model to use. Currently only
#' "simple" is supported.
#' @param ... used internally for testing, ignore it
Expand Down Expand Up @@ -95,19 +93,19 @@
#' lines(x, dsdm(x, mu=0, c=coef['c_Intercept'],
#' kappa=coef['kappa_Intercept']), col='red')
#' }
sdm <- function(resp_error, links = NULL, version = "simple", ...) {
sdm <- function(resp_error, version = "simple", ...) {
call <- match.call()
stop_missing_args()
.model_sdm(resp_error = resp_error, links = links, version = version, call = call, ...)
.model_sdm(resp_error = resp_error, version = version, call = call, ...)
}

#' @rdname SDM
#' @export
sdmSimple <- function(resp_error, links = NULL, version = "simple", ...) {
sdmSimple <- function(resp_error, version = "simple", ...) {
warning("The function `sdmSimple()` is deprecated. Please use `sdm()` instead.")
call <- match.call()
stop_missing_args()
.model_sdm(resp_error = resp_error, links = links, version = version, call = call, ...)
.model_sdm(resp_error = resp_error, version = version, call = call, ...)
}

#############################################################################!
Expand Down
7 changes: 2 additions & 5 deletions man/SDM.Rd

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

8 changes: 4 additions & 4 deletions man/bmm.Rd

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

26 changes: 3 additions & 23 deletions man/imm.Rd

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

5 changes: 1 addition & 4 deletions man/mixture2p.Rd

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

5 changes: 1 addition & 4 deletions man/mixture3p.Rd

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

0 comments on commit 196bbd0

Please sign in to comment.