Re: [R] add diagonal line

2010-10-28 Thread Gavin Simpson
On Wed, 2010-10-27 at 13:17 -0200, Marcelo Lima wrote:
 Hi,
 
 I would like to add a line on the diagonal of a covariance matrix, is there
 a quick way to do it besides abline?
 
 Thanks!

What's wrong with abline()? It does exactly what you want.

By the way,  reproducible example such as requested by David would
something like:

cmat - matrix(rnorm(100), ncol = 10)
diag(cmat) - 1
contour(1:10, 1:10, cmat)
abline(11, -1, col = red, lwd = 2)
box()

I.e. some code with example data that shows us what you are trying to
do. It is not always possible to grep the meaning from a textual
description sufficiently well to be able to move from there to code.
This is discussed in the posting guide.

HTH

G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London  [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] add diagonal line to covariance matrix

2010-10-23 Thread Uwe Ligges



On 22.10.2010 19:36, Marcelo Lima wrote:

Hi,

Created a covariance matrix and i would like to add a diagonal line to the
plot, any suggestions?



I do not really understand your question. If you actually want to access 
the main diagonal of a matrix or add a diagonal matrix to another 
matrix, see ?diag


Uwe Ligges



Thanks




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] add diagonal line to covariance matrix

2010-10-22 Thread Marcelo Lima
Hi,

Created a covariance matrix and i would like to add a diagonal line to the
plot, any suggestions?

Thanks

-- 
Marcelo Andrade de Lima
UNIFESP - Universidade Federal de São Paulo
Departamento de Bioquímica
Disciplina de Biologia Molecular
Rua Três de Maio 100, 4 andar - Vila Clementino, 04044-020
Lab +55 11 55764438 R.1188
Cell +55 11 92725274
ml...@unifesp.br

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.