[R] Accessing data
Paul Lemmens
P.Lemmens at nici.kun.nl
Mon May 17 12:49:13 CEST 2004
Hoi TEMPL,
--On maandag 17 mei 2004 10:46 +0200 TEMPL Matthias
<Matthias.Templ at statistik.gv.at> 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[,-"Besch"]
> x[,!"Besch"]
> attach(x)
> x[-Besch]
> ...
>
Try
x2 <- subset(x, select=-Besch)
kind regards,
Paul
--
Paul Lemmens
NICI, University of Nijmegen ASCII Ribbon Campaign /"\
Montessorilaan 3 (B.01.05) Against HTML Mail \ /
NL-6525 HR Nijmegen X
The Netherlands / \
Phonenumber +31-24-3612648
Fax +31-24-3616066
More information about the R-help
mailing list