sdratio <- function(D, d) with( D[d,], sd(x)/sd(y) )
Ajay Shah mayin.org> writes:
:
: I know that if:
:x = seq(1,10)
:d = c(7,3,2)
: and if I say
:y = x[d]
: then I get the vector y as (7,3,2). Very clever! This idea is used
: intensively with the boot library.
:
: Now consider
Hi,
- Original Message -
From: "Ajay Shah" <[EMAIL PROTECTED]>
>
> But this doesn't work since if D is a data frame, you can't say
> D[d]. Let me show you:
>
> > x = runif(100)
> > y = runif(100)
> > D = data.frame(x, y)
> > d = c(7,3,2)
> > E = D[d]
> Error in "[.data.frame"(D, d) : undef
I know that if:
x = seq(1,10)
d = c(7,3,2)
and if I say
y = x[d]
then I get the vector y as (7,3,2). Very clever! This idea is used
intensively with the boot library.
Now consider the following code (which works):