% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/qsort_data.R
\name{qsort_data}
\alias{qsort_data}
\alias{validate_qsort}
\alias{check_distribution}
\alias{infer_distribution}
\alias{parse_distribution}
\title{Construct a validated qsort_data object}
\usage{
qsort_data(
  Y,
  statements = NULL,
  participants = NULL,
  distribution = NULL,
  metadata = list(),
  source = "manual",
  validate = TRUE
)

validate_qsort(qdata, distribution = NULL)

check_distribution(Y, distribution)

infer_distribution(Y)

parse_distribution(x)
}
\arguments{
\item{Y}{A \verb{J x N} numeric matrix (statements as rows, participants
as columns) or a data frame.}

\item{statements, participants}{Optional character vectors of IDs;
default to \code{S1..SJ} and \code{P1..PN}.}

\item{distribution}{Optional integer vector of forced-distribution
counts. Inferred from \code{Y[, 1]} when \code{NULL}.}

\item{metadata}{Optional named list of study-level info.}

\item{source}{Provenance string stored on the object.}

\item{validate}{If \code{TRUE} (default), run \code{\link[=validate_qsort]{validate_qsort()}} and emit
warnings / messages for any issues found.}

\item{qdata}{A \code{qsort_data} object or bare matrix, passed to
\code{validate_qsort()}.}

\item{x}{Numeric vector, character string, or path to a file
containing the forced distribution, passed to
\code{parse_distribution()}.}
}
\value{
\code{qsort_data()} returns a \code{qsort_data} S3 list with fields
\code{Y}, \code{statements}, \code{participants}, \code{distribution}, \code{metadata}, and
\code{source}. \code{validate_qsort()} returns a list with \code{valid}, \code{issues},
\code{warnings}, and \code{summary}. \code{check_distribution()} returns a list
with \code{ok}, \code{non_conforming}, and \code{grid_values}.
\code{infer_distribution()} and \code{parse_distribution()} return integer
vectors.
}
\description{
\code{qsort_data()} is the canonical constructor for a Q-sort dataset.
\code{validate_qsort()}, \code{check_distribution()}, and \code{infer_distribution()}
are the validation helpers used internally by the constructor and
by the file readers. \code{parse_distribution()} accepts a numeric vector,
a comma-/semicolon-/space-separated string, or a text file containing
one of those.
}
