Help:Drawing graphs: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(→‎R-tools: kivilajidata added)
Line 42: Line 42:
x = "Aika"
x = "Aika"
)  
)  
# data from http://fi.opasnet.org/fi_wiki/index.php?title=Kivilajien_kemiallinen_koostumus&oldid=16183
objects.get("yRxoBZmZBL5GOP6D")
head(data)
nrow(data)
ggplot(data[data$Observation == "Mean", ], aes(x = Element, y = Result, colour = Sequence)) +
geom_point() +
theme_grey(base_size = 20)


</rcode>
</rcode>

Revision as of 22:56, 4 December 2012


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

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