R/amscale_constuctor.R

Defines functions amscale_constructor

amscale_constructor <- function(stimuli, respondent, fit, ninput, nresp, nstim) {

  stopifnot(is.numeric(stimuli), is.atomic(stimuli))
  stopifnot(is.data.frame(respondent))
  stopifnot(is.numeric(fit), is.atomic(fit))
  stopifnot(is.numeric(ninput), is.atomic(ninput))
  stopifnot(is.numeric(nresp), is.atomic(nresp))
  stopifnot(is.numeric(nstim), is.atomic(nstim))

  out <- structure(list(stimuli = stimuli,
                        respondents = respondent,
                        fit = fit,
                        ninput = ninput,
                        nresp = nresp,
                        nstim = nstim),
                   class="amscale")

  return(out)

}
philswatton/philspackage documentation built on Jan. 30, 2023, 3:20 p.m.