Have a look at ?outer
outer(1:10, 10:1)
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
To call in the statistician
I have two vectors of probability distribution of the same length n for
random variable X and Y. I want to built matrix of two-dimension
distribution for X and Y with assumption of independence.
P(X=i,Y=j)=P(X=i)*P(Y=j)
I want to do this very fast for n=120 and big amount of different
distribution
Berwin Turlach has pointed out that to
be equivalent to the original answer the
code should be:
plot(a, ylim = range(a) * (1 + 0.06 * c(-1,1)))
On Fri, Jan 9, 2009 at 2:22 PM, Gabor Grothendieck
wrote:
> Or even:
>
> plot(a, ylim = range(a) + 0.06 * c(-1, 1))
>
>
> On Fri, Jan 9, 2009 at 2:07 PM
WOW, Gabor, that is fancy. I have gotten better at this R thing, but
have far to go. That is a neat solution.
thanks
Stephen
On Fri, Jan 9, 2009 at 2:22 PM, Gabor Grothendieck
wrote:
> Or even:
>
> plot(a, ylim = range(a) + 0.06 * c(-1, 1))
>
>
> On Fri, Jan 9, 2009 at 2:07 PM, Mike Prager w
Or even:
plot(a, ylim = range(a) + 0.06 * c(-1, 1))
On Fri, Jan 9, 2009 at 2:07 PM, Mike Prager wrote:
> "stephen sefick" wrote:
>
>> low <- min(a*0.98)-(min(a)*0.04)
>> high <- max(a*1.02)+(max(a)*0.04)
>> plot(a, ylim=c(low, high))
>
> Unless I am misreading your example, this can be done a
"stephen sefick" wrote:
> low <- min(a*0.98)-(min(a)*0.04)
> high <- max(a*1.02)+(max(a)*0.04)
> plot(a, ylim=c(low, high))
Unless I am misreading your example, this can be done a little
more compactly as:
plot(a, ylim = range(a * 0.94, a * 1.06))
--
Mike Prager, NOAA, Beaufort, NC
* Opinions
WOW, I am not going to post after midnight. Thank you for your
response, and this is what I settled on.
`plot.e` <- function(b, w, x, y, z){
a <- window.chron(b, w, x, y, z)
low <- min(a*0.98)-(min(a)*0.04)
high <- max(a*1.02)+(max(a)*0.04)
plot(a, ylim=c(low, high))
lines(a*0.98, col="blue")
lin
On Fri, 2009-01-09 at 00:22 -0500, stephen sefick wrote:
> library(StreamMetabolism)
> plot.e <- function(b, w, x, y, z){
> a <- window.chron(b, w, x, y, z)
> low <- min(b*0.98)+5
> high <- max(b*1.02)+5
> plot(a, ylim=c(low, high))
> lines(a*0.98, col="blue")
> lines(a*1.02, col="red")
> }
>
> p
library(StreamMetabolism)
day <- (structure(c(10.08, 10.08, 10.05, 10.03, 10, 9.98, 9.96, 9.95,
9.95, 9.96, 9.96, 9.98, 10.01, 10.05, 10.06, 10.09, 10.11, 10.11,
10.13, 10.13, 10.15, 10.15, 10.13, 10.14, 10.11, 10.13, 10.14,
10.13, 10.12, 10.13, 10.14, 10.16, 10.18, 10.19, 10.23, 10.27,
10.33, 10.
I am not sure I understand your question. I get the following output
from your code and it does not look like act.surv.time is repeated:
> m
treat strata time censorTime act.surv.time censoring
[1,] 1 1 0.8331923 0.654723930.65472393 1
[2,] 1 1 0.33
hie
i'm tryimg to generate two survival data using the following code (I know
its ugly ) but it seems to repeat two of the variables can any one tell me
whats the porblem.
n=20
n1=n/2
n2=n/4
a11=1 ;a12=1.4 ;a21=16 ;a22=a12 * a21
t1<-array(1,c(n1))
On Monday 17 September 2007, you wrote:
> R 2.6.0 has Reduce;
>
> myvec <- c(2, 8, 24, 26, 51, 57, 58, 78, 219)
> Reduce(function(myvec, p) setdiff(myvec, findSubsets2(p)), myvec, myvec)
Thanks Gabor, at first I jumped off my chair but... for many input variables
it takes to reduce the vector. M
R 2.6.0 has Reduce;
myvec <- c(2, 8, 24, 26, 51, 57, 58, 78, 219)
Reduce(function(myvec, p) setdiff(myvec, findSubsets2(p)), myvec, myvec)
On 9/16/07, Adrian Dusa <[EMAIL PROTECTED]> wrote:
>
> Dear list,
>
> I have a vector of numbers, let's say:
>
> myvec <- c(2, 8, 24, 26, 51, 57, 58, 78, 219
Dear list,
I have a vector of numbers, let's say:
myvec <- c(2, 8, 24, 26, 51, 57, 58, 78, 219)
My task is to reduce this vector to non-reducible numbers; small numbers can
cross-out some of the larger ones, based on a function let's say called
reduce()
If I apply the function to the first e
14 matches
Mail list logo