File: mscale.Rd

package info (click to toggle)
r-cran-psychotools 0.6-0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,112 kB
  • sloc: ansic: 139; sh: 13; makefile: 2
file content (55 lines) | stat: -rw-r--r-- 857 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
\name{mscale}

\alias{mscale}
\alias{mscale<-}

\title{Extract/Replace Measurement Scale}

\description{
  Generic functions for extracting and replacing the measurement scale from an object.
}

\usage{
  mscale(object, \dots)
  mscale(object) <- value
}

\arguments{
  \item{object}{an object.}
  \item{\dots}{arguments passed to methods.}
  \item{value}{an object describing the measurement scale.}
}

\examples{
## methods for "paircomp" data
pc <- paircomp(rbind(
  c(2,  1,  0),
  c(1,  1, -1),
  c(1, -2, -1),
  c(0,  0,  0)))
pc

## extract
mscale(pc)

## replace (collapse to >/=/< scale)
mscale(pc) <- sign(mscale(pc))
pc


## similar for "itemresp" data
ir <- itemresp(cbind(
  c(-1, 0, 1, 1, 0),
  c(0, 1, 2, 1, 2),
  c(1, 2, 1, 1, 3)))
ir

## extract
mscale(ir)

## replace (single scale for all items)
mscale(ir) <- 1:3
ir
}

\keyword{classes}