Learn R Programming

tempR (version 0.10.1.1)

count.selections: Count attribute selections

Description

Count the number of times that the attribute was selected (or optionally: deselected) in a single TCATA or TDS evaluation.

Usage

count.selections(x, deselections = FALSE)

Value

count of selections (or deselections if deselections = TRUE)

Arguments

x

vector of binary data (with possible values 0 or 1)

deselections

set to TRUE if purpose is to count the number of deselections

Details

Count the number of times that the attribute was selected (or, optionally, deselected) in a single TCATA or TDS evaluation.

Examples

Run this code
data(bars)
paste0(bars[1, -c(1:4)], collapse = "")
# this attribute was checked 3 times and unchecked 2 times
count.selections(bars[1, -c(1:4)])
count.selections(bars[1, -c(1:4)], deselections = TRUE)

Run the code above in your browser using DataLab