Loading...
 
Testing the customoutput parameter, introduced in PluginR v0.87, to produce no hardcoded graphical output from PluginR, but leave the r script inside the plugin to manage chart generation. In a later step, image is displayed with either img for images, or mediaplayer for pdf's, videos, etc.

RR Code
# Derived from http://www.r-bloggers.com/why-i-use-ggplot2/
if(!require(ggplot2)){ install.packages("ggplot2", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
if(!require(grid)){ install.packages("grid", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
if(!require(dplyr)){ install.packages("dplyr", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }

library(ggplot2)
library(grid)
library(dplyr)

tmpfile <- download.file("http://varianceexplained.org/files/ggplot2_example.rda", destfile="ggplot2_example.rda")
load("ggplot2_example.rda")
top_data <- cleaned_data %>%
  semi_join(top_intercept, by = "systematic_name")
g2 <- ggplot(top_data, aes(rate, expression, color = nutrient)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE) +
  facet_wrap(~name + systematic_name, scales = "free_y")
png("testr.png", width=800, height = 1000)
grid.draw(g2)
invisible(dev.off())


{img src="temp/cache/R_r_test08_customoutput/testr.png"}

Image

RR Code
# Derived from http://www.r-bloggers.com/why-i-use-ggplot2/
if(!require(ggplot2)){ install.packages("ggplot2", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
if(!require(grid)){ install.packages("grid", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
if(!require(dplyr)){ install.packages("dplyr", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }

library(ggplot2)
library(grid)
library(dplyr)

tmpfile <- download.file("http://varianceexplained.org/files/ggplot2_example.rda", destfile="ggplot2_example.rda")
load("ggplot2_example.rda")
top_data <- cleaned_data %>%
  semi_join(top_intercept, by = "systematic_name")
g2 <- ggplot(top_data, aes(rate, expression, color = nutrient)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE) +
  facet_wrap(~name + systematic_name, scales = "free_y")
pdf("testr.pdf", width=800, height = 1000)
grid.draw(g2)
invisible(dev.off())
 

{mediaplayer fullscreen="true" src="temp/cache/R_r_test08_customoutput/testr.pdf" width="100%" height="600px" style="normal" wmode="transparent"}






Show php error messages