Re: [R] incorrect number of dimensions

2014-09-11 Thread David L Carlson
Look below to see what happens to your formatting when you use html. Don't use html. Why do you use x='df' in defining the function df is a data frame with 5 observations and 4 variables. 'df' is a character vector of length 1. Your function is looking for a data frame (or matrix) with at least

Re: [R] incorrect number of dimensions

2010-08-03 Thread Dennis Murphy
Hi: This is pure speculation since you didn't provide a minimal data set to test this with, but is it possible that theta is meant to be a parameter *vector*? If so, then you should have eta <- theta[1] K <- theta[2] The code theta[, 1] means that you want to extract the first column of the _mat

Re: [R] incorrect number of dimensions

2010-08-03 Thread Wu Gong
Hi, Please check your dimensions of theta. > ff <- function(theta) theta[,1] > theta <- 1:5 > ff(theta) Error in theta[, 1] : incorrect number of dimensions > theta <- data.frame(c(1:5),c(6:10)) > ff(theta) [1] 1 2 3 4 5 - A R learner. -- View this message in context: http://r.789695.n4

Re: [R] Incorrect number of dimensions

2009-12-06 Thread Uwe Ligges
Sarah wrote: I am trying to fit a linear model with seasonal effects but keep getting 'Incorrect number of dimensions'. I have no idea what this means or how to fix it. I am following instructions received from an instructor and it worked for him, so I assume it has something to do with my da