#! /usr/bin/R main <- formData$title if (is.na(main) || main=="NA") { main <- paste("Histogram of",formData$datname) } tag(HTML) tag(HEAD) tag(TITLE) cat(main) untag(TITLE) untag(HEAD) comments("Some comments to be ignored by the web browser") lf(2) tag(BODY) lf(2) tag(h1) cat("Histogram of your data") untag(h1) lf(2) ## Commented out debugging Code. ##cat("Title = ",formData$title,", datname =",formData$datname) tag(p) tag(h2) cat("Your data (",formData$datname,"):") untag(h2) tag(pre) data <- as.numeric(scanText(formData$data)) print(data) untag(pre) untag(p) lf(2) tag(h2) cat("Here is your histogram") untag(h2) webPNG("hist1.png") breaks <- formData$breakType if (breaks == "NA") breaks = as.numeric(formData$nbins)[1] if (is.na(breaks)) breaks = "Sturges" cat("Break style",breaks); br() hist(data,freq=FALSE,breaks=breaks,main=main,xlab=formData$datname) width <- as.numeric(formData$width) if (is.na(width)) width <- 1.0 cat("Kernel",formData$kernel,"width",width) ; br() den <- density(data,kernel=formData$kernel,width=width) lines(den,col=formData$col,lty=as.numeric(formData$lty)) img(src = "hist1.png") ; br(2) lf(2) cat("You can copy and paste the histogram picture to use in other reports.") lf(2) cat("To try other data, or other values for the parameters," cat("hit the back button on your browser.") lf() cat("The author is ") mailto("Russell Almond", "ralmond@admin.fsu.edu") lf() tag(p) cat("Output produced at ", date()) untag(p) lf() untag(BODY) lf() untag(HTML) lf()