static bool run_factor (struct dataset *ds, const struct cmd_factor *factor);
-static void do_factor_by_matrix (const struct cmd_factor *factor, struct idata *idata);
+static bool do_factor_by_matrix (const struct cmd_factor *factor, struct idata *idata);
casereader_destroy (r);
}
-static void
+static bool
do_factor_by_matrix (const struct cmd_factor *factor, struct idata *idata)
{
+ if (!idata->mm.cov && !idata->mm.corr)
+ {
+ msg (ME, _("The dataset has no complete covariance or correlation matrix."));
+ return false;
+ }
+
if (idata->mm.cov && !idata->mm.corr)
idata->mm.corr = correlation_from_covariance (idata->mm.cov, idata->mm.var_matrix);
if (idata->mm.corr && !idata->mm.cov)