search for: pmat

Displaying 20 results from an estimated 36 matches for "pmat".

Did you mean: pat
2011 Apr 04
3
Adjusting p values of a matrix
...ents. How can I best correct the p values of the matrix? Notably, the total number of the tests performed is n(n-1)/2, since I do not test the correlation of each variable with itself. That means, I only want to correct one half of the matrix, not including the diagonal. Therefore, simply writing pmat <- p.adjust( pmat, method= "fdr" ) # where pmat is an n x n matrix ...doesn't cut it. Of course, I can turn the matrix in to a three column data frame with n(n-1)/2 rows, but that is slow and not elegant. regards, j. -- -------- Dr. January Weiner 3 ---------------------------...
2008 Aug 02
1
problem with nested loop for regression
...ts over a data one row at a time. I have been struggling with the code for many days now, testing various parts, and I cannot seem to get the nested loop to work as I want it to. I would be very grateful for any suggestions. Below is a brief version of my code: #Code start library(zoo) seed.set(1) Pmat<-matrix(rnorm(1000), nrow=100, ncol=100) maxcol<-ncol(Pmat) maxrow<-nrow(Pmat) startrow<-10 period<-10 wind<-2 #roll window subdiv<-period/wind rollstart<-11 #start roll at period+1 #converting Pmat into ts for rollapply() to work... P...
2011 Apr 13
1
Overcoming warning in package zoo
...have a long program that I am trying to run--I am using RStudio as my interface with R. The pieces of the program run well individually but when I try to run everything in sequence it bogs down because of a warning after using rollmax from package zoo. Here is the warning: "In rollmax.zoo(zoo(Pmat), 7, na.pad = FALSE, align = "right") : na.pad is deprecated. Use fill." The code that generates this warning islibrary(zoo)Pmax <- as.data.frame(rollmax(zoo(Pmat), 7, na.pad = FALSE, align = "right")) I also obtain the same warning when I run Pmax <- as.data.frame...
2004 Aug 26
1
Adding 3D points
I would like to add individual points and lines to a persp() plot that I generated with the geoR package. It is a kriged surface map of a field plot and I'd like to overlay my sampling points on it but am having some trouble. I loaded the scatterplot3d package, but I can't seem to use the add parameter with it. Any suggestions?
2018 Apr 25
1
Can't Get Lattice Histogram Minor Tick Marks to Work
...the major tickmarks on # the vertical axis? # Thanks for your help, # Don Macnaughton donmac at matstat.com # Generate data in an 20 x 2 matrix for left panel. In my real application # the data file contains many more rows, but that's not necessary here. for (i in 1:20) { if (i == 1) {pmat = c(0.045,0)} else { pmat = rbind(pmat,c(i*0.05-0.001,0))} } # Generate data for the right panel in the same matrix. counts = c(90, 12.5, 9, 8, 7, 6.5, 6, 5.5, 5, 4.5, 4, 3.5, 3, 2.8, 2.2, 2, 1.8, 1.6, 1.4, 1.0) for (i in 1:20) { maxCount = 100 * co...
2002 Mar 18
2
persp(): add second plane (second, long question)
...two planes would fit the box (x and y values are the same for both (1x6vectors)). And I'm able to store the z-values in two different matrices (6x6). What I did then is > xachse<-c(1:6) > yachse<-xachse > > par(bg = "white") > > trans3d <- function(x,y,z,pmat) { + tmat <- t((cbind(x,y,z,1)%*% pmat)) + list(x=tmat[1,]/tmat[4,],y=tmat[2,]/tmat[4,]) + } > pmat <- persp(xachse, yachse, betaon1.median.plot,zlim=c(2.75,3.30), theta = 60, phi = 20, + col = "lightblue", xlab = "X", ylab = "Y", zlab = &quo...
2018 Apr 25
0
Can't Get Lattice Histogram Minor Tick Marks to Work
Per the Posting Guide, why didn't you post the reproducible R code example? On April 24, 2018 8:22:15 PM PDT, Donald Macnaughton <donmac at matstat.com> wrote: >I'm drawing a paneled histogram using the lattice package. I've >succeeded in >adding minor tick marks to the vertical axis, but I can't get the >desired >number of minor tick marks between the major
2018 Apr 25
3
Can't Get Lattice Histogram Minor Tick Marks to Work
I'm drawing a paneled histogram using the lattice package. I've succeeded in adding minor tick marks to the vertical axis, but I can't get the desired number of minor tick marks between the major tick marks. I've attached a self-contained program to illustrate the problem. Thanks for your help, Don Macnaughton Here's my sessionInfo: R version 3.4.3 (2017-11-30) Platform:
2002 Mar 14
1
persp(): add second plane
Dear R-users, is it possible to add a second plane to the persp()-plot? I couldn't find any hint on that in the news archive... I'm using R.1.4.1 for Windows. Thanks in advance, Nina -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or
2002 Mar 14
1
persp(): add second plane
Dear R-users, is it possible to add a second plane to the persp()-plot? I couldn't find any hint on that in the news archive... I'm using R.1.4.1 for Windows. Thanks in advance, Nina -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or
2002 Aug 01
4
What does persp() return?
I want to plot some 3D points on top of the grid produced by persp(). On 2/22/01, Paul Murrell <paul at stat.auckland.ac.nz> wrote in R-help: > In S-Plus, persp() returns a value that can be used to transform 3D > locations to 2D, but this sort of thing is not (yet) available in R. But persp() does return something (in R-1.5.1): a 4x4 matrix which in the C code is called the
2009 Mar 14
4
persp plot + plotting grid lines
Dear all; Does anyone know how to add grid lines to a persp plot? I've tried using lines(trans3d..) but the lines of course are superimposed into the actual 3d surface and what I need is something like the plot shown in the following link: http://thermal.gg.utah.edu/tutorials/matlab/matlab_tutorial.html I'll appreciate any ideas Thanks PM
2012 Apr 20
1
lines on persp plot - proper depth ordering
...t was the first one I could get working). Here is a semi-contrived minimal example of my problem: ########################################################### #line 1 x1=0:10; y1=rep(0,11); z1 = rep(5,11); #line 2 x2=y2=z2 = 0:10 # make empty persp plot (awful hack to make a surface out of view) pmat = persp(x=c(-10.1,-10), y=c(-10.1,-10), z=matrix(c(0,.1,0,.1), nrow=2), xlim=c(0,10), ylim=c(0,10), zlim=c(0,10), xlab='x', ylab='y', zlab='z') # now draw the lines lines( trans3d(x1, y1, z1,pmat), col="grey", lwd=3) lines( trans3d(x2, y2, z2,pmat), col="...
2005 May 06
1
persp( ) Question
....grid, y = Y.grid)) persp(X.grid, Y.grid, pred.loess1, theta = 0, phi = 12) I would like to add a series of points along the fitted surface at X.grid = 2, in red. The example in the online help uses f <- function(x,y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r } trans3d <- function(x,y,z, pmat) { tr <- cbind(x,y,z,1) %*% pmat list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4]) } phi <- seq(0, 2*pi, len = 201) r1 <- 7.725 # radius of 2nd maximum xr <- r1 * cos(phi) yr <- r1 * sin(phi) lines(trans3d(xr,yr, f(xr,yr), res), col = "pink", lwd=2) to add points to t...
2002 Oct 21
2
3-D scatter plot laid over Surface plot
Hello, I have created a Fitness surface (persp()), with data that was created by a tp spline procedure. Now I would like to superimpose a set (XYZ) of existing points (from two different treatments) onto this surface. I didn't come across any function or command that is able to do this in R. Could somebody please help me in finding a solution to this problem Thank you Peter --
2004 Nov 19
4
3d Map with bars
Apologies in advance for the question. I am trying to draw a map of the US as a surface plot so that I would be able to drop bars on the different states (something like Uwe Ligges' scatterplot3d example 4). I am not sure where to start looking for such a beast. If anyone has any pointers, ideas, I will be grateful. TIA, Partha
2003 Dec 25
6
Plot a sphere
Hi, I'm new to R (and math ;) Would somebody please be so kind as to direct me in plotting a 3D sphere? I tried something in the lines of: #### y <- x <- seq(-pi, pi, length=pi*10) f <- function(x,y) { z <- sqrt(pi - x^2 - y^2) #z[is.na(z)] <- 0 z } z <- outer(x, y, f) persp(x, y, z, theta = 120, phi = 30) #### I've also tried: .... make.surface.grid(...) ..
2004 Feb 18
3
persp and lines()
R-sters: I'm interested in keeping data plotted in persp to preserve the wireframe look, I'd just like to change one of the lines drawn (in either the x or y direction) into a different color so that it stands out. Or is there some way to add a line (say, via lines(), or abline()) to a persp() plot at the designated x or y that would follow the z surface contour? I could add a line
2004 Oct 26
1
persp(), scatterplot3d(), "..." argument
...ts3d <- function(x,y,z, jj.colour="black", ...){ if(is.matrix(x)){ z <- x[,3] y <- x[,2] x <- x[,1] } z.grid <- matrix(range(z),2,2) persp(range(x), range(y), z.grid, col = NA,border=NA, ...) -> res trans3d <- function(x,y,z, pmat) { tr <- cbind(x,y,z,1) %*% pmat list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4]) } points(trans3d(x,y,z,pm=res), col=jj.colour, ...) } With this, things like O <- matrix(rnorm(60),20,3) points3d(O,jj.colour="red",pch=16,theta=30,phi=40) work as expec...
2004 Oct 26
1
persp(), scatterplot3d(), "..." argument
...ts3d <- function(x,y,z, jj.colour="black", ...){ if(is.matrix(x)){ z <- x[,3] y <- x[,2] x <- x[,1] } z.grid <- matrix(range(z),2,2) persp(range(x), range(y), z.grid, col = NA,border=NA, ...) -> res trans3d <- function(x,y,z, pmat) { tr <- cbind(x,y,z,1) %*% pmat list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4]) } points(trans3d(x,y,z,pm=res), col=jj.colour, ...) } With this, things like O <- matrix(rnorm(60),20,3) points3d(O,jj.colour="red",pch=16,theta=30,phi=40) work as expec...