% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tools-data.R
\name{get.block.items.from.data.FCDCM}
\alias{get.block.items.from.data.FCDCM}
\title{Extract Block Items from FCDCM Data}
\usage{
get.block.items.from.data.FCDCM(data)
}
\arguments{
\item{data}{An \eqn{N \times B} character matrix (or data frame) of
binary-preference strings.  Each cell must be of the form
\code{"a>b"} or \code{"b>a"} where \code{a} and \code{b} are global
statement indices.  Missing values are skipped.}
}
\value{
A list of length \eqn{B}.  Each element is a two-element integer
vector \code{c(a, b)} with \code{a < b}.
}
\description{
Recovers the two-item composition of each FCDCM block from a character
data matrix of \code{"a>b"} / \code{"b>a"} preference strings.  Because
every FCDCM block always compares exactly two statements, this function
only needs to inspect the first non-missing row of each column.
}
\details{
The returned item pair is sorted in ascending order.  For example, both
\code{"1>3"} and \code{"3>1"} imply \code{c(1L, 3L)} for that block.  This
sorted pair is then the default coding direction used by
\code{\link{get.response.from.data.FCDCM}}: response value 1 means the
first element of the pair was preferred, and response value 0 means the
second element was preferred.

This helper assumes the two compared statements are fixed within each
column.  If a column accidentally mixes different item pairs, only the first
parseable non-missing cell determines the returned pair, so such data should
be cleaned before conversion.
}
\examples{
dat <- data.frame(
  b1 = c("1>3", "3>1", "1>3"),
  b2 = c("2>4", "2>4", "4>2"),
  stringsAsFactors = FALSE
)
get.block.items.from.data.FCDCM(dat)
}
\seealso{
\code{\link{get.block.items.from.data}} for the generic multi-item
variant used by FCGGUM, FCMIRT, and TIRT.

\code{\link{get.response.from.data.FCDCM}} to convert FCDCM data strings
to a 0/1 response matrix.
}
