[R] Accessing data

About this list Date view Thread view Subject view Author view Attachment view

From: TEMPL Matthias (Matthias.Templ@statistik.gv.at)
Date: Mon 17 May 2004 - 18:46:58 EST


Message-id: <83536658864BC243BE3C06D7E936ABD50153A59F@xchg1.statistik.local>

Hello,

I would like to access my data frame without one variable.

E.g.:
> colnames(x)
[1] "Besch" "Ang.m" "Arb.m" "i10" "Umsatz" "arbstd"

I can try x[,-1], but this variable must be called by itīs name.

x[,-"Besch"]
x[,!"Besch"]
attach(x)
x[-Besch]
...
...
does not work.

I could not found a solution of this little problem in any scripts about R and in google.

Should I type in x[,c("Ang.m","Arb.m","i10","Umsatz","arbstd")] to access my data frame without variable "Besch", or is there any better solution.

Some of my data frames has ~100 variables and so is x[,c(...)] a little bit exhausting.

Thanks for any help,

Matthias

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:11 EST