Displaying 20 results from an estimated 8000 matches similar to: "Plotting Upper triangle of Matrix with diagonal as the Base"
2003 Mar 01
1
error message from gls(), unstructured in lower triangle, identical diagonal, help.
Hi, nlme users,
I am fitting a model for repeated measures, using
gls(). The var-cov structure is UNSTRUCTURED in lower
triangle and identical for the diagonal, for which I
still have no idea how to fit using PROC MIXED.
The error message is as follows:
Error in "coef<-.corNatural"(*tmp*, value =
log((cStNatPar + 1)/(1 - cStNatPar))) :
NA/NaN/Inf in foreign function call
2007 Oct 10
3
as.dist with diagonal unequal zero
Hello and sorry that I still haven?t found a solution for my problem.
I need to extract the lower and upper triangle from a square matrix
including the diagonal. This diagonal is not zero in that special case.
I tried with as.dist
w<-as.dist(w, diag = TRUE)
> w
1 2 3 4 5
1 0
2 2 0
3 3 8 0
4 4 9 14 0
5 5 10 15 20 0
but found no way to keep the diagonal that is in the
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
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
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]]
2007 Feb 07
2
blank upper or lower triangle of cor-matrix
Dear altogether,
I want to blank the lower (or upper) part of a correlation matrix as it
is done by dist()
example:
( d <- cor(matrix(runif(12),nrow=4)) )
If I do the following
d[lower.tri(d)] <- ""
of course everything is changed to character - that's not what should be.
Additionally, it does not work to assign "0" or anything else. The same
is true for
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` =
2007 Nov 29
1
?eigen documentation suggestion
from ?eigen
symmetric: if 'TRUE', the matrix is assumed to be symmetric (or
Hermitian if complex) and only its lower triangle is used. If
'symmetric' is not specified, the matrix is inspected for
symmetry.
I think that could mislead a naive reader as it suggests that, with symmetric=TRUE,
the result of eigen() (vectors and values) depends only on
2007 Jun 20
1
How to extract diagonals
Hello,
I am using Mac OS X on a power book and R 2.5.0
I try to extract a diagonal from a dissimilarity matrix made with
dsvdis, with this code:
diag(DiTestRR)
But I get this error message:
Fehler in array(0, c(n, p)) : 'dim' spezifiziert ein zu großes Array
english:
Error in array(0, c(n, p)) : 'dim' specifies a too big array.
Is there a limit to extract diagonals?
I
2005 Mar 01
2
almost lower triangular matrices
I have output from a program which produces a distance matrix I want to
read into a clustering program in R.
The output is a .txt file and is 'almost' lower triangular in the sense
that it is just the triangle below the diagonal.
So for example a 4-by-4 distance matrix appears as,
1
2 3
4 5 6
i.e. it looks like a lower triangular of a 3-by3.
I thought I might be able
2007 Aug 16
6
an easy way to construct this special matirx
Hi,
Sorry if this is a repost. I searched but found no results.
I am wondering if it is an easy way to construct the following matrix:
r 1 0 0 0
r^2 r 1 0 0
r^3 r^2 r 1 0
r^4 r^3 r^2 r 1
where r could be any number. Thanks.
Wen
[[alternative HTML version deleted]]
2009 Nov 27
2
Symmetric Matrix classes
Hi,
I'd like to store large covariance matrices using Matrix classes.
dsyMatrix seems like the right one, but I want to specify just the
upper/lower triangle and diagonal and not have to instantiate a huge
n^2 vector just for the sake of having half of it ignored:
Dumb example:
M <- new("dsyMatrix", uplo="U", x=rnorm(1e4), Dim=as.integer(c(100, 100)))
diag(M) <- 1
2007 Jun 25
2
Re : Half of a heatmap
> I am trying to produce a heatmap of pairwise correlations, but since the matrix is
> symmetric, I only need either the upper or the lower triangle. I have scoured the
> web and R documentation, but I have not been able to find a way to produce such a
> figure. Is there a simple way to produce a heat map with only the part above or
> below the diagonal?
You might want to check
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 Sep 21
1
How to put given values in lower triangle of splom-plot?
Dear R-experts,
I have found a splom-modification online which is given below. This
works perfectly, but I would like to have a matrix of given
correlation values to be used in the lower triangular part
(lower.panel) of the splom-plot instead of calculated correlation
values. Here is the matrix I would like to use (it can be any other
convenient data structure):
2011 Mar 18
3
exploring dist()
Hello, everybody,
I hope somebody could help me with a dist() function.
I have a data frame of size 2*4087 (col*row), where col corresponds to the
treatment and rows are
species, values are Hellinger distances, I should reconstruct a distance
matrix
with a dist() function. I know that "euclidean" method should be used.
When I type:
dist(dframe,"euclidean")
it gives me a
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
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,
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
return( -100*x+0*y+100*z )
}
x = seq( 1, 0,
2004 Jan 12
1
Matrix indexes
Two questions about matrix indexing:
Is is correct that V <- V[lower.tri(V, diag=TRUE)] returns the lower
triangular of matrix V, that is: all elements above diagonal are set to zero? I
understand that the triangle of matrix elements of V for which lower.tri is
TRUE are returned while the others (above diagonal) are set to zero (or NA ???).
If D and B are vectors of logicals,
what