[R] data frame titles

Chris Arthur chris.arthur at bristol.ac.uk
Wed Jun 4 10:57:26 CEST 2008


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

Chris



More information about the R-help mailing list