Displaying 20 results from an estimated 3000 matches similar to: "how to rotate a triangle image(ZMAT) ?"
2007 Jun 18
4
triangle contour plots
Suppose I have three numbers p1, p2, p3 with
0 <= p1,p2,p3 <= 1 and p1+p2+p3=1,
and a function f=f(p1,p2,p3) = f(p1,p2,1-p1-p2).
How to draw a contour plot of f() on the p1+p2+p3=1 plane,
that is, an equilateral triangle?
Functions triplot(), triangle.plot(), and ternaryplot() give
only scatterplots, AFAICS
--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre,
2011 Jul 12
1
spatial logit help
Please I am new to R. I got the following code from a friend:
gmat <- cbind(gmat,p*(1-p)*wxb)
for (j in seq(1:ncol(gmat))) {
gmat[,j] <- fitted(lm(gmat[,j]~zmat))
}
It is for spatial logit.
After defining all the matrices in it such as P, wxb, gmat, and zmat,
I tried to run it in R and got the following error message:
Error in model.frame.default(formula = gmat[, j] ~ zmat,
2011 Oct 13
2
how to plot two surfaces with lattice::wireframe
Hi all,
I'd like to plot the Real and Imaginary parts of some f(z) as two
different surfaces in wireframe (the row/column axes are the real and
imag axes). I know I can do it by, roughly speaking, something like
plotz <- expand.grid(x={range of Re(z)}, y={range of Im(z), groups=1:2)
plotz$func<-c(Re(f(z),Im(f(z))
wireframe(func~x*y,data=plotz,groups=groups)
But that seems like a
2007 Aug 30
2
Need help putting histograms on the diagonal of a splom plot
Hello,
I am in need of help in putting histograms on the diagonal of a plot
produced with splom().
The plot matrix I am trying to produce is to have standard scatterplots
in the upper-left triangle, contour plots in the lower-right triangle,
and histograms on the diagonal. I have a function that does the first
two, but the histograms on the diagonal has been beyond my ability.
Here is my
2005 Jan 13
1
how to use solve.QP
At the risk of ridicule for my deficient linear algebra skills, I ask
for help using the solve.QP function to do portfolio optimization. I
am trying to following a textbook example and need help converting the
problem into the format required by solve.QP. Below is my sample code
if anyone is willing to go through it. This problem will not solve
because it is not set up properly. I hope I
2013 Oct 05
3
trying to compile R in win 7 (with Rtools)
hello all,
I am trying to compile the R in Win7
and compiles one small part
but the script don't move from the 'base' directory to 'stats'
I installed the Rtools likee administrator
and call the terminal (MS-DOS) like administrator too.
if somebody can tell me any tips, I thank in advanced
cleber
#############################################
File LOG
2008 Feb 21
2
triangle.plot - change the axes orientation
Hello, I need to chenge axes orirentation in triangle plot. (function
triangle.plot in ade4 package)
I want to plot elasticities of some species in demographic triangle, where
axes values commnly increace "clockwise".
If some better imangination is needed, see
http://www.open.ac.uk/science/biosci/personalpages/j.silvertown/pdfs/Silvertown%20et%20al.%201993.pdf
I am sorry if I just
2008 Mar 18
1
How to reverse colors in filled.contour?
Hi,
I am plotting values of log(hazards ratio) as a function of two predictors,
using the plotting function filled.contour(). Here is a simple simulated
example of this:
x <- seq(0,1, length=20)
y <- seq(0,1, length=20)
z <- outer(x,y, function(x,y) x^2 + y^2 )
zmat <- matrix( rexp(n=400, rate = z+0.001), 20, 20)
filled.contour(x, y, log(zmat),
2008 Jan 26
5
double-click in RData file versus load( file )
hello all,
when I start up the R and I execute o follow code:
> ls()
character(0)
> x=123
> assign("test_x", x, envir = .GlobalEnv )
> ls()
[1] "test_x" "x"
> setwd('C:\\R\\etc')
> save.image('TEST.RData')
> q('no')
I have two different behaviours:
(a) - when I start up R again by "double click" in
2006 Apr 03
2
Ternary or Triangular Plots (soil texture triangle plot)?
Hi,
I am trying to create a triangular plot to show the 'composition' of a
set of items with three variables (historically the percent sand, silt
and clay in soil).
So far I have tried the 'soil texture triangle plot' in the package
plotrix and the 'ternary or triangular plots' in the package cwhtool
(cwhmisc). Both have strengths and weaknesses, but neither has a
2008 Jul 03
2
Plotting Prediction Surface with persp()
Hi all
I have a question about correct usage of persp(). I have a simple neural
net-based XOR example, as follows:
library(nnet)
xor.data <- data.frame(cbind(expand.grid(c(0,1),c(0,1)), c(0,1,1,0)))
names(xor.data) <- c("x","y","o")
xor.nn <- nnet(o ~ x + y, data=xor.data, linout=FALSE, size=1)
# Create an (x.y) surface and predict over all points
d <-
2011 Dec 28
1
Pascal's Triangle
Hello,
Looking to generate Pascal's triangle in R. How do I get started? Thanks,
--
Matilda Gogos
matildaelizabethv@gmail.com
[[alternative HTML version deleted]]
2010 Mar 12
3
how to plot only the upper triangle using the pairs function?
Hi,
I am trying to use function pairs to plot the scatterplot, but I only want
to keep the upper triangle, what's the argument to do this?
Thanks,
-Jack
[[alternative HTML version deleted]]
2011 Jun 04
1
library(SenoMineR)- Triangle Test Query
Dear R Group
I was trying to use the triangle.test function in SensoMineR and strangely i
encounter a error in the output of preference matrix from the analysis.
To illustrate, pl see the following dataframe of a design with the response
and preference collected as shown below:
design<-structure(list(`Product X` = c(3, 1, 4, 2, 4, 2, 1, 3, 4, 2,
4, 2, 1, 3, 4, 2, 4, 2, 3, 1), `Product Y` =
2010 Sep 02
2
lower triangle of the correlation matrix with xtable
Dear all,
mydata<-data.frame(x1=c(1,4,6),x2=c(3,1,2),x3=c(2,1,3))
cor(mydata)
x1 x2 x3
x1 1.0000000 -0.5960396 0.3973597
x2 -0.5960396 1.0000000 0.5000000
x3 0.3973597 0.5000000 1.0000000
I wonder if it is possible to fill only lower triangle of this
correlation matrix? Using 'dist' doesn't seem to be useful as it doesnt
allow to convert this table
2010 Jul 08
1
Data format question for triangle.plot package ade4
hello,
I am trying to develop a triangle plot but am having difficultly assigning
the row.names to the 3 columns in the data.frame
Here is what I've done,
attach(SoilVegHydro)
dim(SoilVegHydro)
1292 39
# now take 3 variables from main data.frame for plotting
dat <- cbind.data.frame(TP, meanAnnualDepthAve, BulkDensity) # These are
variables held in the data frame SoilVegHydro
2006 Jul 08
2
String mathematical function to R-function
hello
I make a subroutine that give-me a (mathematical)
function in string format.
I would like transform this string into function ( R
function ).
thanks for any tips.
cleber
#e.g.
fun_String = "-100*x1 + 0*x2 + 100*x3"
fun <- function(x1,x2,x3){
return(
############
evaluation( fun_String )
############
)
True String mathematical function :-( :-(
> nomes
[1]
2002 Dec 20
1
lower triangle
Hi,
I want to compute the lower triangle of a square matrix (optionally, sans
diagonal). With for() loops I can do something like this:
## 5 by 5 matrix rtn
for (j in 1:5) {
for (k in 1:j) {
if (j != k) { ## optional
rtn[j, k] <- my.func(j, k)
}
}
}
I'd like to do this with apply(). Is there some way I can do this kind of
'short-circuit'?
Thanks,
Mark Wilkinson
2006 Jun 19
1
Plotting Upper triangle of Matrix with diagonal as the Base
Hi..
I a have a symmetric matrix to plot . I would like to plot only the Upper triangle but with the diagonal as the Base of the rectangle. Is there an easy way to do it.
Thanks.
Harsh
---------------------------------
[[alternative HTML version deleted]]
2008 Jun 09
1
Plot Coloured Triangle
Hi there,
I'd like to plot a triangle with each point having a certain color defined and
fill it with the interpolated values.
The following code shall represent somehow, three points with x,y, and the
"amount" of red for example...
point1 <- c(1.1, 1.7, 255)
point2 <- c(2.2, 1.5, 180)
point3 <- c(1.8, 2.2, 60)
can anybody give me a hint which methods to use to realize