ta Zahn wrote:
From: baptiste auguie
To: Dimitris Rizopoulos
Date: Tue, 13 Jan 2009 09:38:09 +
Subject: Re: [R] indexing question
you can also look at subset,
my.data.frame <- data.frame(a=rnorm(10),
b=factor(sample(letters[1:4], 10, replace=T)))
str(my.data.frame)
rying to determine if I need to
break my habit of naming data.frames "data".
Thanks,
Ista
>
>
> On Tue, Jan 13, 2009 at 9:53 AM, Ista Zahn wrote:
> > From: baptiste auguie
> > To: Dimitris Rizopoulos
> > Date: Tue, 13 Jan 2009 09:38:09 +
> > Subjec
on? Or are there cases where naming data.frames, vectors, matrices,
> etc. can also cause problems?
>
> I hope I'm not being annoying -- I'm just trying to determine if I need to
> break my habit of naming data.frames "data".
>
> Thanks,
> Ista
>
>>
t; Date: Tue, 13 Jan 2009 09:38:09 +
> Subject: Re: [R] indexing question
>
>> you can also look at subset,
>>
>>
>>my.data.frame <- data.frame(a=rnorm(10),
>>> b=factor(sample(letters[1:4], 10, replace=T)))
>>>str(my.da
From: baptiste auguie
To: Dimitris Rizopoulos
Date: Tue, 13 Jan 2009 09:38:09 +
Subject: Re: [R] indexing question
> you can also look at subset,
>
>
>my.data.frame <- data.frame(a=rnorm(10),
>> b=factor(sample(letters[1:4], 10, replace=T)))
>&g
an be extracted from a given body of
data.
~ John Tukey
-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
project.org]
Namens Bunny, lautloscrew.com
Verzonden: dinsdag 13 januari 2009 10:26
Aan: r-help@r-project.org
Onderwerp: [R] indexing question
Hi a
reasonable answer can be extracted from a given body of
data.
~ John Tukey
-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
Namens Bunny, lautloscrew.com
Verzonden: dinsdag 13 januari 2009 10:26
Aan: r-help@r-project.org
Onderwerp: [R] indexing
you can also look at subset,
my.data.frame <- data.frame(a=rnorm(10),
b=factor(sample(letters[1:4], 10, replace=T)))
str(my.data.frame)
my.data.frame[my.data.frame$b == "a", ]
subset(my.data.frame, b == "a")
by the way, it is probably safer not to use "data" as a va
have a look at ?"[.data.frame"; what you need is the following:
dat <- data.frame(a = rbinom(20, 1, 0.5), x = rnorm(20), y = rnorm(20))
dat
dat[dat$a == 1, ]
I hope it helps.
Best,
Dimitris
Bunny, lautloscrew.com wrote:
Hi all,
i have a pretty easy indexing question, at least i believe so
Hi all,
i have a pretty easy indexing question, at least i believe so. The
main reason i post it here, is that brackets and $ are hard to google.
How do I index correctly, if i just want to display the whole dataset
conditioned on the fact that some particular column equals one.
I know i
10 matches
Mail list logo