the description of the
> problem, rather than the code provided, presuming that the code was not
> correct, including the use of 'replace' and 'prob' in sample().
>
> I suppose it would be up to Daniel for clarification.
>
> Regards,
>
> Marc
>
>
&
3, replace = TRUE, prob = probs[i, ])
}
Is there a another way to do this?
Thanks!
Dan Gerlanc
--
Daniel Gerlanc
Williams College '07
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the pos
Hello all,
Consider the following problem:
There are two vectors:
rows <- c(1, 2, 3, 4, 5)
columns <- c(10, 11, 12, 13, 14)
I want to create a matrix with dimensions length(rows) x length(columns):
res <- matrix(nrow = length(rows), ncol = length(columns))
If "i" and "j" are the row and colum
Hello All,
I've sent a few messages to the list regarding splitting a formula
into its right and left hand terms. Thanks to everyone who has
responded.
I believe that the best way to extract the left and right hand terms
as character vectors follows:
library(nlme)
formula <- y ~ x + z
left.te
Hi All,
I sent the following message to R-help on July 14th, 2006:
Let's say I have the following formula:
a.formula <- x ~ y + z
I want to extract the left and right-hand sides of the function so
that I have two character vectors like the ones you would create using
the following assignments:
"y", "z")
One way to do this follows:
left.hand.side <- unlist(dimnames(attr(terms(a.formula), "factors"))[1])
right.hand.side <- unlist(dimnames(attr(terms(a.formula), "factors"))[-1])
Is there a better or