John Maindonald
September 2 2014
Once the abilities of a program are under the R umbrella, all of existing R is available for use, for data input, data manipulation, graphics, …
Every project can become an exercise in combining together all the text for a report or paper, and code for all computer output, including graphs and tables. On a click of a mouse, the report, or presentation, or paper, automagically appears.
It can happen!
“Female hurricanes are deadlier than male hurricanes”,
by Jung, Shavitta, Viswanathana, and Hilbe.
http://www.pnas.org/cgi/doi/10.1073/pnas.1402786111
The paper has caused a stir on the blogosphere.
The new (Sept 2 2014) preview release of RStudio.
has much enhanced abilities for creating interactive
documents. Download from:
http://www.rstudio.com/products/rstudio/download/preview/
The R package shiny supplies the needed web application
framework. See:
http://rmarkdown.rstudio.com/authoring_shiny.html
To learn about Shiny, go to
http://shiny.rstudio.com/tutorial/
https://github.com/mages/googleVis/tree/master/vignettes
Click on Using_googleVis_with_knitr.Rmd
Replace path2file with the path to your file.
library(memisc)
path2file <- "sourceDir/zzz.sav"
nys1987Imp <- spss.system.file(path2file)
show(nys1987Imp)
desc <- description(nys1987Imp)
The above has imported file details only. The following examines description details for the first four fields:
desc[1:4]
The function codebook() provides more extensive
information. The following provides codebook
details for the first four fields:
codebook(nys1987Imp[,1:4], eval=FALSE)
Use as.data.set() to extract the data,
into an memisc data.set object. Use
as.data.frame() to create a data frame
from the data.set object. There may be
some loss of information,
nys1987 <- as.data.set(nys1987Imp)
##
## Can now do, e.g.
nys1987Cols1to20 <- subset(nys1987,
select=names(desc)[1:20])