{RR(echo="1" cacheby="pagename")}
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
if(!require(rpivotTable)) devtools
require(rvest)
require(htmlwidgets)
require(rpivotTable)
file<-read_html(site)
tables<-html_nodes(file, "table")
saveWidget(pt, file="tiki15_pivottable.html", selfcontained = FALSE)
{RR}
Open PIVOT TABLE in new window
- Check and Install missing packages if any
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)
- Get the data from an internet site (or by other means in other cases)
file<-read_html(site)
tables<-html_nodes(file, "table")
- Data is in the only table in that page
- Convert list to data frame
- Two extra commands for quick look inthe R console to the data structure and first 6 row of values. Uncomment if needed.
- str(table1)
- head(table1)
- Create the pivot table and save html on disk
- pt <- rpivotTable(table1)
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.