[R] data frame titles

From: Chris Arthur <chris.arthur_at_bristol.ac.uk>
Date: Wed, 04 Jun 2008 09:57:26 +0100

I'm new to R so please forgive the newbie question; but i can't seem to find a definitive answer to this.

I am wanting to do a PLS regression on some data. Which takes a formula of the type
"responseACC ~ dataACC"

where dataACC is multivariate in nature and responseACC is a single value.

I have imported my data from a csv file into a dataframe called for arguments sake df.
This file has no headers in it so I get column names X1.....X83

I then create a new data frame which says data.frame(dataACC = df[1:82], responseACC = df[83])

When I look at the names of this though I get...

dataACC.X1 ..... dataACC.X82 and then X83

When I pass this to the PLS algorithm I get the error

"variable responseACC not found"

So a few questions, Am I doing this in the right way in general? why is the responseACC not being associated as the name of df[83]?

Thirdly, If I want to generate my own array of values in order to do get a predicted response based on my initial PLS regression, will it matter that the array data will not have header values (eg dataACC.X1 etc)? if so what the best way of appending the header data?

Thanks for any help you can lend


R-help_at_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. Received on Wed 04 Jun 2008 - 10:53:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 04 Jun 2008 - 11:30:36 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive