[R] puzzled with plotmath II

Claudia Beleites cbeleites at units.it
Thu Jan 20 12:51:07 CET 2011


sorry, I forgot my sessionInfo: please see below.


-------- Original Message --------
Subject: puzzled with plotmath
Date: Thu, 20 Jan 2011 12:48:18 +0100
From: Claudia Beleites <cbeleites at units.it>
To: R Help <r-help at r-project.org>

Dear all,

I'm puzzled with matrix indices in plotmath.

I'm plotting matrix elements: Z [i, i], and I'd like to put that as label. I'll
describe what I want and what I get in LaTeX-notation.

The output should look like Z_{i, i}, and my first try was
plot (1, 1, ylab = expression (Z[i, i]))

That, however, gives me Z_{i} (no comma, no second i) although the expression
looks OK to me:
> a <- expression (Z[i, i])
> a [[1]]
Z[i, i]
> str (as.list (a [[1]]))
List of 4
  $ : symbol [
  $ : symbol Z
  $ : symbol i
  $ : symbol i

I'm able to tweak the ouput looking as I want:
plot (1, 1, ylab = expression (Z[i][", "][i]))
which is, however, logically very far from what I want to express.

What am I missing?

I'm almost sure this has been discussed before, but I can't find it: can anyone
point me to good search terms? Is it possible to search for the terms being
close to each other in RSiteSearch and/or RSeek? I get lots of introductory
documents as they point to plotmath and discuss matrices...

Thanks a lot for your help,

Claudia

 > sessionInfo ()
R version 2.12.1 (2010-12-16)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_US.utf8       LC_NUMERIC=C              LC_TIME=en_US.utf8
  [4] LC_COLLATE=en_US.utf8     LC_MONETARY=C             LC_MESSAGES=en_US.utf8
  [7] LC_PAPER=en_US.utf8       LC_NAME=C                 LC_ADDRESS=C
[10] LC_TELEPHONE=C            LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] ggplot2_0.8.8 proto_0.3-8   reshape_0.8.3 plyr_1.2.1

loaded via a namespace (and not attached):
[1] digest_0.4.2 tools_2.12.1

-- 
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbeleites at units.it



More information about the R-help mailing list