Loading...
 

Profile_r_test15_pivottables

{RR(echo="1" cacheby="pagename")}
  1. Check and Install missing packages if any
if(!require(rvest)){ install.packages("rvest", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
if(!require(devtools)){ install.packages("devtools", lib="/usr/lib/R/site-library", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/") }
if(!require(htmlwidgets)) devtools
install_github("ramnathv/htmlwidgets") #

if(!require(rpivotTable)) devtools
install_github("smartinsightsfromdata/rpivotTable") #

require(rvest)
require(htmlwidgets)
require(rpivotTable)

  1. Get the data from an internet site (or by other means in other cases)
site <- "https://dev.tiki.org/Tiki15"
file<-read_html(site)
tables<-html_nodes(file, "table")

  1. Data is in the only table in that page
table1 <- html_table(tables1, fill = TRUE)
  1. Convert list to data frame
table1 <- as.data.frame(table1)

  1. Two extra commands for quick look inthe R console to the data structure and first 6 row of values. Uncomment if needed.
  2. str(table1)
  3. head(table1)

  1. Create the pivot table and save html on disk
  2. pt <- rpivotTable(table1)
pt <- rpivotTable(data = table1, rows = c("Submitted.By","Category"), cols=c("Resolution.Status","Importance"), vals = "Title", aggregatorName = "Count", rendererName = "Heatmap", width="100%", height="800px")
saveWidget(pt, file="tiki15_pivottable.html", selfcontained = FALSE)
{RR}

Open PIVOT TABLE in new window

{iframe name="myChart" width="1000" height="800" align="middle" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto" src="temp/cache/{{domainslash_if_multitiki}}R_{{page}}/tiki15_pivottable.html"}


Plugin execution pending approval

This plugin was recently added or modified. Until an editor of the site validates the parameters, execution will not be possible.