Re: [R] Accessing data

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

From: Petr Pikal (petr.pikal@precheza.cz)
Date: Mon 17 May 2004 - 18:53:03 EST


Message-id: <40A8998F.9592.1A87FE@localhost>

Hi

On 17 May 2004 at 10:46, TEMPL Matthias wrote:

> 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[,names(x)!="Besch"]

should work but maybe there is some better solution

Cheers
Petr

> 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

Petr Pikal
petr.pikal@precheza.cz

______________________________________________
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