~matthieu-rakotojaona/zim/couchdb-store

« back to all changes in this revision

Viewing changes to data/manual/Plugins/GNU_R_Plot_Editor.txt

  • Committer: Matthieu Rakotojaona
  • Date: 2012-05-07 19:50:49 UTC
  • Revision ID: matthieu.rakotojaona@gmail.com-20120507195049-fza1a6q5oleuyhp6
working tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Content-Type: text/x-zim-wiki
 
2
Wiki-Format: zim 0.4
 
3
 
 
4
====== GNU R Plot Editor ======
 
5
 
 
6
The GNU R plot editor is, as its name suggests, a simple dialog that allows you to insert plotting scripts in GNU R's 'S' language.
 
7
 
 
8
**Dependencies:** This plugin requires GNU R to be installed.  For specific notebooks which others have created, bear in mind that they may have used GNU R with additional libraries installed.  In this case, as well as GNU R, you will need the same libraries installed that others used.
 
9
 
 
10
===== Syntax =====
 
11
 
 
12
Some quick examples of the GNU R syntax.  For a complete reference see the links below.
 
13
 
 
14
 
 
15
{{./gnu_r_plot.png?type=gnu_r_plot}}
 
16
 
 
17
'''
 
18
x = seq(-4,4,by=0.01)
 
19
y = sin(x) + 1
 
20
plot(x,y,type='l')
 
21
'''
 
22
 
 
23
 
 
24
        {{./gnu_r_plot001.png?type=gnu_r_plot}}
 
25
 
 
26
'''
 
27
# Maunga Whau Volcano Example
 
28
# Copyright (c) //R Development Core Team [5]//
 
29
x <- 10*(1:nrow(volcano)); x.at <- seq(100, 800, by=100)
 
30
y <- 10*(1:ncol(volcano)); y.at <- seq(100, 600, by=100)
 
31
 
 
32
# Using Terrain Colors
 
33
 
 
34
image(x, y, volcano, col=terrain.colors(100),axes=FALSE)
 
35
contour(x, y, volcano, levels=seq(90, 200, by=5), add=TRUE, col="brown")
 
36
axis(1, at=x.at)
 
37
axis(2, at=y.at)
 
38
box()
 
39
title(main="Maunga Whau Volcano", sub = "col=terrain.colors(100)", font.main=4)
 
40
'''
 
41
 
 
42
 
 
43
===== Features Available =====
 
44
 
 
45
Be aware that this plugin pre-sets the png device to render graphics.  For that reason, you should not try to use the other device commands (or to redefine the png device command).  For example, the 3d plotting devices that render to OpenGL rather than png should not be used, nor should the jpg output.
 
46
 
 
47
Aside from this, most of R's advanced plotting power should be available to you.
 
48
 
 
49
===== References =====
 
50
 
 
51
* An Introduction to R [1]
 
52
* The R Website [2]
 
53
* The R Wiki [3]
 
54
 
 
55
* [1] http://cran.r-project.org/doc/manuals/R-intro.html
 
56
* [2] http://www.r-project.org/index.html
 
57
* [3] http://rwiki.sciviews.org/
 
58
* [4] http://cran.r-project.org/banner.shtml
 
59
* [5] http://addictedtor.free.fr/graphiques/RGraphGallery.php%3Fgraph%3D22
 
60