This is an R Markdown document. Markdown is a simple formatting syntax for authoring web pages (click the MD toolbar button for help on Markdown).
When you click the Knit HTML button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2
## 1st Qu.:12.0 1st Qu.: 26
## Median :15.0 Median : 36
## Mean :15.4 Mean : 43
## 3rd Qu.:19.0 3rd Qu.: 56
## Max. :25.0 Max. :120
You can also embed plots, for example:
plot(cars)
require(googleVis)
## Loading required package: googleVis
## Warning: package 'googleVis' was built under R version 2.15.1
## Loading required package: RJSONIO
## Warning: package 'RJSONIO' was built under R version 2.15.1
## Welcome to googleVis version 0.2.17
##
## Please read the Google API Terms of Use before you use the package:
## http://code.google.com/apis/terms/index.html
##
## Type ?googleVis to access the overall documentation and
## vignette('googleVis') for the package vignette. You can execute a demo of
## the package via: demo(googleVis)
##
## More information is available on the googleVis project web-site:
## http://code.google.com/p/google-motion-charts-with-r/
##
## Contact: <rvisualisation@gmail.com>
##
## To suppress the this message use:
## suppressPackageStartupMessages(library(googleVis))
# Voorbeeld van het gebruik van googlevis gauge charts in R
#
# PO COCKPIT 4 antwoorden : 1 = Team Score 2 = Score geintervieuwde 3 =
# Score respondent 1 4 = Score respondent 2 Initialiseer variabelen
k <- "Barney"
r1n <- "Wilma"
r2n <- "betty"
k_regenboog <- round((44 + 48)/2, 1)
r1_regenboog <- round((36 + 52)/2, 1)
r2_regenboog <- round((36 + 44)/2, 1)
t_regenboog <- round((k_regenboog + r1_regenboog + r2_regenboog)/3, 1)
# Nu het initialiseren van de gauges en het dataframe aanmaken
gaugelabels <- c("Team", k, r1n, r2n)
gaugeneedles <- c(t_regenboog, k_regenboog, r1_regenboog, r2_regenboog)
gaugedata <- data.frame(gaugelabels, gaugeneedles)
gauge <- gvisGauge(gaugedata, options = list(min = 0, max = 100, greenFrom = 51,
greenTo = 100, yellowFrom = 0, yellowTo = 50, width = 800, height = 200))
print(gauge, "chart", file = "gauge-sample.html")
plot(gauge)
## starting httpd help server ...
## done