[R] FORTRAN in R
Thomas Lumley
tlumley at u.washington.edu
Thu Aug 16 17:39:10 CEST 2001
On Fri, 17 Aug 2001, Ko-Kang Kevin Wang wrote:
> I have tried leaps and it kind of works.
>
> However when I tried to make it displays the variables' names instead of
> displaying 1 2 3 4..., I got some error messages.
>
> Suppose I have a data frame called myData. There are 5 variables (H, L,
> S, W, M), where M is the response variable and all the others are
> explanatory variables.
>
> I extracted M out from myData, and call the new data frame (without M) X.
>
> Then I tried:
> leaps( X, M, names=names(X) )
> Error in leaps(X, M, names = names(X)) : couldn't find function
> "col.names<-"
>
> If I do
> leaps( X, M )
> then it works but columns in $which is displayed as 1 2 3 4 instead of H L
> S W.
>
> I also tried to use names=list(names(X)) but it still doesn't work.
>
> Helps will be appreciated ;-)
>
leaps() has an option 'strictly.compatible' that is by default TRUE and as
the help page says,
With `strictly.compatible=T' the function will stop
with an error if `x' is not of full rank or if it has
more than 31 columns. It will ignore the column names
of `x' even if `names==NULL' and will replace them with
"0" to "9", "A" to "Z".
So you need to set strictly.compatible=FALSE to use the names= option.
-thomas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list