Skip to content

Commit

Permalink
Document 'only=' and 'except=' arguments of 'measurement_autolevel()'
Browse files Browse the repository at this point in the history
  • Loading branch information
melff committed Oct 3, 2022
1 parent 75cd02a commit ffb5742
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions pkg/man/measurement-autolevel.Rd
Expand Up @@ -20,6 +20,7 @@ measurement_autolevel(x, \dots)
\S4method{measurement_autolevel}{data.set}(x,
to=getOption("measurement.adapt.default","nominal"),
threshold=getOption("measurement.adapt.threshold",.75),
except=NULL,
only=NULL,
\dots)
}
Expand All @@ -28,9 +29,14 @@ measurement_autolevel(x, \dots)
\item{to}{a character vector, the target measurement level}
\item{threshold}{the proportion of values, if reached the target
measurement level is set}
\item{only}{an optional character vector, the names of the
variables of which the measurement levels should
be automatically adapted.}
\item{except}{a vector with variable names, either as symbols
(without quotation marks) or character strings (with quotation
markes), the variables in the data set that are not to be
changed by \code{measurement_autolevel()}.}
\item{only}{a vector with variable names, either as symbols
(without quotation marks) or character strings (with quotation
markes), the variables in the data set that are to be
changed by \code{measurement_autolevel()}.}
\item{\dots}{other arguments, currently ignored.}
}
\examples{
Expand All @@ -39,4 +45,14 @@ measurement_autolevel(x, \dots)
labels(exvect) <- c(a=1,b=2)
codebook(exvect)
codebook(measurement_autolevel(exvect))

avect <- as.item(sample(1:3,16,replace=TRUE))
labels(avect) <- c(a=1,b=2,c=3)
bvect <- as.item(sample(1:4,16,replace=TRUE))
labels(bvect) <- c(A=1,B=2,C=3,D=4)
ds <- data.set(a=avect,b=bvect)
codebook(ds)
codebook(measurement_autolevel(ds))
codebook(measurement_autolevel(ds,except=c(a,b)))
codebook(measurement_autolevel(ds,only=a))
}

0 comments on commit ffb5742

Please sign in to comment.