Hi list,
I'm running R CMD check for a package and I would like to save the .tex file
that generates later the pdf documentation.
I have only seen it appearing and disappearing quickly in a tmp folder but I
have not been able to save it. I could not find any option to the check command
to sav
On Jun 19, 2012, at 10:02 AM, David L Carlson wrote:
kde2d is for two dimensional data. The persp graph is 3d.
Huh? The question asked about plotting data that was 2d. The third
dimension was to be the density. kde2d in package MASS or the
similarly named function in package KernSmooth would
Hi,
I'm unable to find a way to smooth data for a persp() graph.
Example, suppose that I have data x,y,z like this:
x <- 1:10
y <- 1:10
k <- 20
z <- outer(x, y, "*") + matrix( k*runif(100, -1, 1), 10, 10)
persp(x, y, z, theta = 35, phi = 25)
The graph is not very nice. Is there a way to smooth
Hello,
I have a question regarding the default RNG in R. The helps indicate
that :
The default is "Mersenne-Twister". From Matsumoto and Nishimura
(1998). A twisted GFSR with period 2^19937 - 1 and equidistribution in
623 consecutive dimensions (over the whole period). The ‘seed’ is a
Hello,
This code builds a simple example of 2 wireframes :
require(lattice)
x <- c(1:10)
y <- c(1:10)
g <- expand.grid(x = 1:10, y = 1:10, gr = 1:2)
g$z <- c(as.vector(outer(x,y,"*")), rep(50,100))
wireframe(z ~ x * y, data = g, groups = gr, scales = list(arrows =
FALSE))
However, the inters
Because we want the values in table(x[,2]) where the **names** are
as.character(x[,1][x[,1] > 0])], not the positions x[,1][x[,1] > 0])].
Thanks!
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the p
table(x2)[as.character(x[,1][x[,1] > 0])]
Why do I need as.character() here? I checked it does not work without,
but I don't see why. The help says "as.character attempts to coerce
its argument to character type".
Thanks very much!
Guillaume
__
Thank you! This is exactly what I wanted. Could you please explain the
logic behind your code?
x[,2][x[,1][x[,1] > 0]] <- table(x[,2])[as.character(x[,1][x[,1] >
0])]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-he
Hello,
I create this array:
x <- cbind(c(1:4, rep(0,10)), c(rep(0,4), 1:2, rep(3,6), 4,5))
[,1] [,2]
[1,]10
[2,]20
[3,]30
[4,]40
[5,]01
[6,]02
[7,]03
[8,]03
[9,]03
[10,]03
[11,]03
[12,]0
I believe this does what you want:
m[-sample(which(m[,1]<8 & m[,2]>12),2),]
Analysis:
Get a boolean vector of rows fitting criteria:
m[,1]<8 & m[,2]>12
What are their indexes?
which(...)
Choose two among those indexes:
sample(...,2)
Thanks, but this does not seem to always work.
Hello all,
I create the following matrix:
m <- matrix(1:20, nrow = 10, ncol = 2)
which looks like:
[,1] [,2]
[1,]1 11
[2,]2 12
[3,]3 13
[4,]4 14
[5,]5 15
[6,]6 16
[7,]7 17
[8,]8 18
[9,]9 19
[10,] 10 20
Then, I want to re
11 matches
Mail list logo