westland <westl...@uic.edu> writes:

> Here is what I have done:
>
> I read in an 10000 x 8 table of data, and assign the first four columns to
> matrix A and the second four to matrix B
>
> pls <-    read.table("C:/Users/Chris/Desktop/SEM Book/SEM Stat
> Example/Simple Header Data for SEM.csv",    header=TRUE, sep=",",
> na.strings="NA", dec=".", strip.white=TRUE)

The problem is here:

> A <- c(pls[1],pls[2],pls[3],pls[4])
> B <- c(pls[5],pls[6],pls[7],pls[8])

This creates lists A and B, not data frames.

Either use cbind() instead of c(), or simply say

A <- pls[,1:4]
B <- pls[,5:8]

The the rest should work.

Btw. it is probably a good idea to avoid single-character names for
variables.  Especially c and C, because they are names of functions in R.

-- 
Regards,
Bjørn-Helge Mevik

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to