Dear R users,
Suppose that I have a matrix A
A <- matrix(c(1,2,3,4),2,2)
> A
[,1] [,2]
[1,]13
[2,]24
With this matrix A, I'd like to create bigger one, for example,
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[,14]
[1,]1313
Dear R users,
I'd like to create a sequence/vector, for example,
1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 4 4 4 4 5 5 5 5 4 4 4
4 5 5 5 5 4 4 4 4 5 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 6 6 6 7 7 7 8 8 8 9
9 9
So I did like this below.
a <- 4
b <- 3
c <- 2
grp <- c( rep(1:b, each=c,
Dear R users,
I have three plots, so I tried, for exmple,
par(mfrow=c(2,2))
y1 <- rnorm(100)
y2 <- rnorm(100)
y3<- rnorm(100)
plot(y1);plot(y2);plot(y3)
Here, I'd like to put a legend on the bottom right hand side (empty space).
is it possible?
Thanks for helping,
TIME. In order
to do that, I guess I need to make a "function". unfortunately, I have no
idea how to do that.
Any suggestion will be greatly appreciated.
Kathryn Lord
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
On Tue, Jan 27, 2015 at 11:47 AM, Kathryn Lord
wrote:
> Dear R users,
>
> Suppose I have a matrix A.
>
> > p <- 1:4
> > q <- 1:5
> > P<-rep(p, each=5)
> > Q<-rep(q, 4)
> >
> > A <- cbind(P,Q)
> > A
> P Q
> [1,]
r 'q's (1,2,3,4) and
the forth 'p' element (4) has two 'q's (1,2); in other words,
Is there the easyiest way to create B,...,E in R?
Actually, the example above is a toy example and the matrix A I have is
around 10,000 by 10,000 and the pattern is also
uld I make the above vectors using R?
Any suggestion will be greatly appreciated.
Best,
Kathryn Lord
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listin
a1 and
a2.
Using same logic, I'd like to make the matrices (a3, a4, a5) as many as
possible.
Any suggestion will be greatly appreciated.
Best,
Kathryn Lord
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list --
9 10 11 12 13 14
[3,] 15 16 17 18 19 20 21
[4,] 22 23 24 25 26 27 28
Matrices a1 and a2 have different columns, and I guess there are such many
matrices.
Any suggestion will be greatly appreciated.
Best,
Kathryn Lord
[[alternati
)
rho_24 <- rho(uu[,2],uu[,5])
rho_34 <- rho(uu[,3],uu[,4])
rho_35 <- rho(uu[,3],uu[,5])
rho_45 <- rho(uu[,4],uu[,5])
Actually, the matrix uu is huge, 20*1000. Would you plz tell me how to
calculate "rho", more efficiently??
Any suggestion will be greatly
Dear R users,
I have two different vectors like below
x <- c( NA, NA, 3, NA, 1)
y <- c( 20, 40 ,50)
Combining x and y, I'd like to create new vector z
z <- c(20, 40, 3, 50, 1)
Any suggestion will be greatly appreciated.
Best,
Kathryn Lord
[[alternative HTML v
1] [,2] [,3] [,4] [,5] [,6]
[1,]79 11 000
[2,] 0008 10 12
[[3]]
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 13 15 17 000
[2,] 000 14 16 18
Any suggestion will be greatly appreciated.
Regards,
K
ll be greatly appreciated.
Regrads,
Kathryn Lord
p.s.
Here is R code.
--
> dat <- as.data.frame(matrix( c( 2, 1, 1, 3, 1, 1, 6, 1, 0, 5, 0, 0), 4, 3,
byrow=T))
> covar <- apply(dat[,-1],1,paste,collapse='')
>
13 matches
Mail list logo