0

How can I write

$\mathcal{O}$(LaTeX code) 

in legend of a plot in R?

Gavin Simpson
  • 170,508
  • 25
  • 396
  • 453
user2227801
  • 85
  • 1
  • 8
  • 1
    See [this question](http://stackoverflow.com/questions/15480082/r-plot-mathematical-expression-in-axis-label) or [this question](http://stackoverflow.com/questions/1395105/getting-latex-into-r-plots) for instance. – plannapus Apr 02 '13 at 14:09
  • I can not install the package "tikzDevice" in R 2.15.2 – user2227801 Apr 02 '13 at 14:13
  • @user2227801 **tikzdevice** was removed from CRAN. You can install versions by hand from the archive: http://cran.r-project.org/web/packages/tikzDevice/index.html – Gavin Simpson Apr 02 '13 at 14:14
  • I tried but I couldn't install this package. Is there another way? – user2227801 Apr 02 '13 at 14:23
  • What do you mean that you couldn't install the package? Did it give errors? Do you just not know how? – Dason Apr 02 '13 at 14:23
  • I'm not very familiar with Latex but if the code you gave is supposed to give the "big O" used in mathematics then `expression(Omicron)` should be equivalent. – plannapus Apr 02 '13 at 14:35
  • Yes, the error is:Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) : cannot open the connection In addition: Warning messages: 1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip file 2: In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) : cannot open compressed file 'tikzDevice_0.6.2.tar.gz/DESCRIPTION', probable reason 'No such file or directory' – user2227801 Apr 02 '13 at 14:37
  • `expression(Omicron)` is not `mathcal(O)`. – user2227801 Apr 02 '13 at 14:41
  • 1
    You will have to build the package by hand. If you're on Windows, you'll need a toolchain (Linux and OSX have it prepacked). Search "how to build r package". – Roman Luštrik Apr 02 '13 at 14:48

0 Answers0