Displaying 20 results from an estimated 483 matches for "triangle".
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%20...
2006 Jun 27
3
how to rotate a triangle image(ZMAT) ?
Hello R users...
how to align this Zmat (triangle image) in X axis?
I would like that the triangle's base become in the X
axis and
the triangle's height become in the Y axis
Is there some trick for make this?
Thanks.
Cleber
######################## my test and try
f <- function(x,y){
z=1-x-y
z[ z < (-1e-15) ] <- NA...
2012 Sep 21
3
(koans) another problem (syntax error)
Hello,
I now trying to solve this one :
# Triangle Project Code.
# Triangle analyzes the lengths of the sides of a triangle
# (represented by a, b and c) and returns the type of triangle.
#
# It returns:
# :equilateral if all sides are equal
# :isosceles if exactly 2 sides are equal
# :scalene if no sides are equal
#
# The tests for...
2011 Apr 02
3
Plotting MDS (multidimensional scaling)
...i,
I just encountered what I thought was strange behavior in MDS. However, it
turned out that the mistake was mine. The lesson learned from my mistake is
that one should plot on a square pane when plotting results of an MDS. Not
doing so can be very misleading. Follow the example of an equilateral
triangle below to see what I mean. I hope this helps others to avoid this
kind of headache.
Let's say I have an equilateral triangle. Then, the three Euclidean
distances between points A, B, and C are all equal. That is,
dist(AB)=dist(AC)=dist(BC). Let the points A, B, and C have
(x,y)-coordinates (0...
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
'standard' or 'generic' feel about it.
To save myself time I would like to ask the list if there is a preferred...
2011 Feb 09
2
Generate multivariate normal data with a random correlation matrix
Hi All.
I'd like to generate a sample of n observations from a k dimensional
multivariate normal distribution with a random correlation matrix.
My solution:
The lower (or upper) triangle of the correlation matrix has
n.tri=(d/2)(d+1)-d entries.
Take a uniform sample of n.tri possible correlations (runi(n.tr,-.99,.99)
Populate a triangle of the matrix with the sampled correlations
Mirror the triangle to populate the other triangle forming a symmetric
matrix, cormat
Sample n observat...
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, Southampton
European Way, Southampton SO14 3ZH, UK
tel 023-8059-7743
2010 Jul 17
1
Help with Reshaping from Wide to Long
I am trying to reshape data that are in the wide format into the long format.
The design is a repeated-measures design, which combined 3 levels of shape
(circle, square, triangle) with 3 levels of color (Blue, Red, Green), for a
total of 9 variables. The wide data look like this (sorry I couldn't get
the columns to line up quite right:
Subject CircleBlue CircleRed CircleGreen SquareBlue SquareRed SquareGreen
TriangleBlue TriangleRed TriangleGreen
1 101...
2009 Aug 24
1
How to generate more triangles in sequences?
Hi everyone,
I want to plot some pattern. For example, I have some coding as below,
plot(0:11,type="n")
polygon(c(6,8,10), c(7,3,5),bor=6)
polygon(c(2,4,6), c(5,3,7),bor=6)
polygon(c(6,10,8), c(7,9,11),bor=6)
polygon(c(2,6,4), c(9,7,11),bor=6)
This coding will give me four triangles, but how to generate more triangles
in sequences so
that not need to mention the coordinate for each triangle?
Thank you.
--
Hemavathi Ramulu
[[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 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]]
2009 Jun 25
3
grid.polygon() + color gradient
Hi,
I wonder whether there is a way to generate a polygon (a triangle in
my case) with color gradient using grid.polygon() in package grid?
I tried something like
library(grid)
grid.polygon(x=c(0, 0.5, 1), y=c(0.5, 1, 0.5), gp=gpar(col=NA,
fill=colorRampPalette(c("green", "lightgray"),
space="Lab&...
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,...
2010 May 09
1
Plot polygon in 3D with rgl
...ticular,
what is the easiest way to plot a section of a plane in 3D, that is
given by the xyz coordinates of the outline?
Suppose I have a polygon - which I know for sure is a set of
coordinates on the same plane. One method I found is to use surf.tri
from the geometry package, and then plot the triangles with
rgl.triangles. This method is not perfect though, because it makes the
convex hull - no good for the polygon below.
thanks for your help,
Remko
# Example polygon in 3D (matrix with tree columns x,y,z)
m <- structure(c(-24.71, -36.45, -59.54, -83.97, -112.63, -126.66,
-152.79, -171.04, -...
2003 Aug 20
1
Filled triangles in lattice graphics?
Dear R users,
I can get a filled triangle pointing upwards by specifying pch=17 in
xyplot or lpoints, but how do I get a filled triangle that points downwards?
In the standard plot function it's possible to use
plot(x,y,pch=25,bg="black"), but bg= doesn't seem to work with lattice
and lpoints.
Thanks,
Hans Gardfjell...
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 with xtable.
print(xtable(cor(mydata),digits=3))
Any ideas?
Cheers,
Olga
2011 Dec 26
1
Finding all triangles in a graph
I have the adjacency matrix of a graph. I'm trying to find all
triangles (embeddings of C_3). This doesn't work:
index = function(l) seq(l)[l]
pairs = do.call(rbind, lapply(seq(nrow(adj)), function(x) cbind(x,
index(adj[x,]))))
triangles = do.call(rbind, apply(pairs, 1, function(x) cbind(x,
index(adj[x[1],] & adj[x[2],]))))
I'm absolutely certain I've...
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) #...
2017 Sep 15
4
RFC: Trace-based layout.
...blocks in a loop.
Overview of proposed solution:
Phase 1:
Greedily produce a set of traces through the function. A trace is a list of
blocks with each block in the list falling through (possibly conditionally)
to
the next block in the list. Loop rotation will occur naturally in this
phase via
the triangle replacement algorithm below. Handling single trace loops
requires a
tweak, see the detailed design.
Phase 2:
After producing what we believe are the best traces, they need to be
ordered.
They will be ordered topologically, except that traces that are cold enough
(As
measured by their warmest block...
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...