User Tools

Site Tools


documents:111012rtricks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
documents:111012rtricks [2012/02/14 22:21] kotadocuments:111012rtricks [2016/05/24 12:46] – external edit 127.0.0.1
Line 77: Line 77:
 } }
 </sxh> </sxh>
 +
 +===== Inserting math formula & symbols in label or title =====
 +
 +The easiest way is to use function //expression()//. For example,
 +<code>
 +plot(back$V2, type='l', xlab=expression(slice %.% time), ylab='intensity', xaxt="n", yaxt="n")
 +</code>
 +Inserts vertically centered dot in the x label between "slice" and "time". You could check other available expressions by
 +<code>
 +?plotmath
 +</code> 
 +
 +More recent, but under development is using [[http://cran.r-project.org/web/packages/tikzDevice/|tikzDevice]].
 +
 +===== Variable Name to String =====
 +
 +<code>
 +myfunc <- function(v1) {
 +  deparse(substitute(v1))
 +}
 +
 +myfunc(foo)
 +[1] "foo"
 +</code>
documents/111012rtricks.txt · Last modified: 2020/11/26 07:08 by kota

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki