Chargement...
 
Imprimer

r_demo09_rcharts_highcharts

{RR(echo="1" cacheby="pagename", caption="Example 1 with HighCharts: Several data series")}

  1. Testing rCharts from http://ramnathv.github.io/rCharts/

if(!require(devtools)){ install.packages("devtools", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
require('devtools', quietly = TRUE )
if(!require(rCharts)){ install_github('rCharts', 'ramnathv') }

h1 <- hPlot(x = "Wr.Hnd", y = "NW.Hnd", data = MASS::survey, type = c("line",
"bubble", "scatter"), group = "Clap", size = "Age")

  1. h1$print("chart5")

h1$LIB2 <- "http://wiki.zollet.fr/rcharts_libraries/highcharts"
h1$save("h1.html")
{RR}

{iframe name="myChart" width="850" height="500" align="middle" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto" src="temp/cache/R_r_demo09_rcharts_highcharts/h1.html"}

Erreur Plugiciel en attente d'approbation

Ce plugiciel a été ajouté/modifié récemment. Son exécution ne sera pas possible avant que l'éditeur de site ne valide ces paramètres.


{RR(echo="1" cacheby="pagename", caption="Example 2 with HighCharts: BoxPlot")}

  1. Testing rCharts from http://ramnathv.github.io/rCharts/

if(!require(devtools)){ install.packages("devtools", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
require('devtools', quietly = TRUE )
if(!require(rCharts)){ install_github('rCharts', 'ramnathv') }

      1. Simulate some data

      1. 3 Factor Variables

FacVar1 = as.factorc("level1", "level2"), 25?
FacVar2 = as.factor(rep(c("levelA", "levelB", "levelC"), 17)-51)
FacVar3 = as.factor(rep(c("levelI", "levelII", "levelIII", "levelIV"), 13)-c(51:52))

      1. 4 Numeric Vars

set.seed(123)
NumVar1 = round(rnorm(n = 50, mean = 1000, sd = 50), digits = 2) ### Normal distribution
set.seed(123)
NumVar2 = round(runif(n = 50, min = 500, max = 1500), digits = 2) ### Uniform distribution
set.seed(123)
NumVar3 = roundn = 50, rate = 0.001? ### Exponential distribution
NumVar4 = 2001:2050

simData = data.frame(FacVar1, FacVar2, FacVar3, NumVar1, NumVar2, NumVar3, NumVar4)

      1. dummy variable created

simData$tmpFac = "tmp"
bwstats = setNames(as.data.frame(boxplot(NumVar1 ~ tmpFac, data = simData, plot = F)$stats),
nm = NULL)
h2 = Highcharts$new()
h2$set(series = listname = "NumVar1 Distribution", data = bwstats?)
h2$xAxis(categories = levels(simData$tmpFac), title = list(text = "Dummy Fac Var"))
h2$yAxis(title = list(text = "NumVar1"))
h2$chart(type = "boxplot")
h2$LIB2 <- "http://wiki.zollet.fr/rcharts_libraries/highcharts"
h2$save("h2.html")
{RR}

{iframe name="myChart" width="850" height="500" align="middle" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto" src="temp/cache/R_r_demo09_rcharts_highcharts/h2.html"}

Erreur Plugiciel en attente d'approbation

Ce plugiciel a été ajouté/modifié récemment. Son exécution ne sera pas possible avant que l'éditeur de site ne valide ces paramètres.