Skip to content
Prev 278491 / 398503 Next

Error: invalid type(list) for variable when using lm()

Inline below.

-- Bert
On Fri, Nov 25, 2011 at 2:31 AM, Milan Bouchet-Valat <nalimilan at club.fr> wrote:
?as.vector
Actually an array **is** a vector -- but with an additional "dim"
attribute. Try:
1) Read relevant portions of R docs, like ?array and perhaps "An
Introduction to R."

2)  Read and follow the posting guide. In particular, give us a toy
example with the code you used to construct your array. It's difficult
to diagnose the source of engine failure without the car.

3) See my comment below.
--This is patently false. Please check before giving obviously wrong advice:
Call:
lm(formula = x[, 3, 2] ~ x[, 1, 1])

Coefficients:
(Intercept)    x[, 1, 1]
    -0.1247       0.1171