Help:Drawing graphs: Difference between revisions

From Opasnet
Jump to navigation Jump to search
Line 99: Line 99:
print(p)
print(p)
# dev.off()
# dev.off()
</rcode>
===Google charts===
This is how you can make fancy Google motion or map charts. See documentation for R package googleVis.
<rcode name='gvistest' embed=1>
library(OpasnetUtilsExt)
library(googleVis) # needed only for the example data, otherwise is included automagically
# Check all the examples at
# http://code.google.com/p/google-motion-charts-with-r/wiki/GadgetExamples
# Opasnet wrapper for gvis-functions, plain and simple as that
google.gvis('Motion Chart', Fruits, idvar="Fruit", timevar="Year", options=list(height=350, width=400))
google.gvis('Geo Map', Exports, locationvar="Country", numvar="Profit",options=list(dataMode='regions',height=480,width=640))
</rcode>
</rcode>



Revision as of 14:46, 13 November 2013


Question

How to draw graphs in Opasnet?

Answer

R-tools

In R-tools, you have the functionalities of R available. We recommend that you use the package ggplot2 whenever possible. It is very powerful, and borrowing good ideas from others is easier if we all use the same approach. Of course, it is also possible to use plot' (a kind of basic graph) as well, but the limits come sooner. This is an example code that contains all kinds of examples with comments.

+ Show code

----#: . Code seems to work, but gives the yellow errorbox saying "Removed 745 rows containing missing values (geom_point)" --Heta 12:56, 27 August 2013 (EEST) (type: truth; paradigms: science: comment)

rlnorm

Graph for cumulative probability distributions

Size of base font:

+ Show code

Google charts

This is how you can make fancy Google motion or map charts. See documentation for R package googleVis.

+ Show code

GoogleDocs

GoogleDocs is the method of choice for drawing causal diagrams.

  • Make a drawing.
  • Share it with everyone with open editing.
  • Download is in png or svg format.
  • Upload the file to Opasnet and copy a link to the original Google document to the image page.
  • Use like any image.

See also