<% 
datasets <- ls('package:datasets')
dataset <- datasets[datasets %in% req$GET()[['data']]][1]
if (is.na(dataset)) dataset <- 'iris'
%>
<html>
<head>
<body>
<h1><%=dataset%> Summary</h1>
<pre>
<%=paste(capture.output(eval(parse(text=sprintf("summary(%s)",dataset)))),collapse='<br>')%>
</pre>
<p> Click on the below:</p>
<ul>
    <li><a href="<%=req$to_url(sprintf("/%s.csv",dataset))%>">CSV representation</a>
    <li><a href="<%=req$to_url(sprintf("/%s.json",dataset))%>">JSON representation</a>
    <li><a href="<%=req$to_url(sprintf("/%s.png",dataset))%>">Plot representation</a>
</ul>

</body>
</html>
