% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tools-data.R
\name{get.data.from.response.FCDCM}
\alias{get.data.from.response.FCDCM}
\title{Convert an FCDCM Response Matrix to FC Data Strings}
\usage{
get.data.from.response.FCDCM(response, block.items)
}
\arguments{
\item{response}{An \eqn{N \times B} integer matrix coded as 0/1 or
1/2, where \eqn{B} is the number of FCDCM blocks.}

\item{block.items}{A list of length \eqn{B}.  Each element is an
integer vector of length 2 giving the two global statement indices
compared in that block.}
}
\value{
A data frame with \eqn{N} rows and \eqn{B} columns.  Each
cell is a character string \code{"a>b"} or \code{"b>a"}.
}
\description{
Converts a binary FCDCM response matrix (0/1 or 1/2 coding) back to
human-readable \code{"a>b"} / \code{"b>a"} preference strings.  Each
block compares exactly two items; the response indicates which item
was selected.
}
\section{Response Coding}{

Two coding conventions are accepted:
\itemize{
\item \strong{0/1 coding}: 1 means the first-named item in
\code{block.items} was preferred; 0 means the second-named
item was preferred.
\item \strong{1/2 coding}: 1 means the first-named item; 2 means
the second-named item.  This is auto-detected and converted.
}
The output always uses \code{"a>b"} format where \code{a} and
\code{b} are the two item indices in the comparison order.

The direction is controlled by \code{block.items}.  If
\code{block.items[[1]] = c(1L, 3L)}, then response value 1 becomes
\code{"1>3"} and response value 0 becomes \code{"3>1"}.  With 1/2 coding,
value 1 has the same meaning as above and value 2 means the second item.
A response matrix must use one coding convention consistently; mixed
\code{0/1/2} values are rejected.
}

\examples{
items <- list(c(1L, 3L), c(2L, 4L))
resp <- cbind(c(1, 0, 1), c(0, 1, 1))
dat <- get.data.from.response.FCDCM(resp, items)
dat
get.response.from.data.FCDCM(dat, items)$response

# The same preferences can also be supplied as 1/2 responses.
resp12 <- cbind(c(1, 2, 1), c(2, 1, 1))
get.data.from.response.FCDCM(resp12, items)
}
\seealso{
\code{\link{get.response.from.data.FCDCM}} for the reverse
conversion.

\code{\link{get.data.from.response}} for the generic multi-item
converter.
}
