I am trying to learn R, and am having problems with doing a simple linear regression. I loaded data from a fixed width file, using wd=c(...), and read.fwf(...) and I can read in the file ok and it comes in as vectors in columns, which is what I expected. The problem is when I try to do a linear regression, lm=(y~x), I get the following error message, "Error in model.frame.default(formula = y ~ x, drop.unused.levels = TRUE) :
invalid type (list) for variable 'y' I tried various things, such as wd=numeric(c(..)), unlist(y) and putting x and y in a data frame and attaching it, but nothing helps. I have searched through 3 online manuals, but can't seem to find an answer. Maybe this is so simple that nobody felt the need to address it. Thanks for your help. B.Kindseth [[alternative HTML version deleted]] ______________________________________________ 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.