[R] so current status of interactive PDF creation isl? trying to explore econometriic convergence thread

Duncan Murdoch murdoch.duncan at gmail.com
Mon May 23 20:42:49 CEST 2011


On 11-05-23 8:04 AM, Mike Marchywka wrote:
>
>
> I think I just saw a thread go by on " how do I make interactive PDF from
> rgl output" but I ignored it at the time and can't seem to find consensus result
> on google. Essentially I wanted to create pdf or other output to
> share a 3D plot and let viewers interact with it but it still wasn't
> clear on easiest way to do this.
> Is this 2009 page the best reference?
>
> http://cran.r-project.org/web/views/Graphics.html
>
> Thanks.
> Specific case of interest is below,
>
> I found rgl to be quite useful in regards to this,
>
> http://r.789695.n4.nabble.com/maximum-likelihood-convergence-reproducing-Anderson-Blundell-1982-Econometrica-R-vs-Stata-td3502516.html#a3512807
>
>
> I generated some data points using this script
> ( which itself uses this data file http://98.129.232.234/temp/share/em.txt )
>
> http://98.129.232.234/temp/share/em.R.txt
>
> After some editing with sed, the output of the above script
> made this data file showing some optimization's
> "trjectory" according to my variables of interest,
>
> http://98.129.232.234/temp/share/emx.dat.txt
>
> df<-read.table("emx.dat",header=F,sep=" ")
>
>
>
>
> I subsequently found a few ways to plot the data,
> notably,
>
> png("em.png")
>
> plot(log(df$V1),df$V2)
>
> png.off()
>
>
>
> http://98.129.232.234/temp/share/em.png
>
>
>
> png("em2.png")
>
> plot(log(df$V1),df$V2,cex=1+.2*(log(df$V3)-min(log(df$V3))))
>
> dev.off()
>
>
> http://98.129.232.234/temp/share/em2.png
>
>
> But what I'd like to do is publish an interactive 3D
> plot of this data similar to the rgl output
> of this,
>
> df<-read.table("emx.dat",header=F,sep=" ")
> library(rgl)
> rgl.points(log(df$V1),df$V2,log(df$V3))
>
> quick google search and ?rgl didn't seem
> to provide immediate answer.
>
> Is there a way to publish interactive plots?

Not in general, but for some plots there is.  See Luke Tierney's paper 
on the topic:

http://www.stat.uiowa.edu/~luke/R/misc3d/misc3d-pdf/misc3d-pdf.pdf

Presumably one of the approaches he used could be made more general, but 
it's a fair bit of work.

Duncan Murdoch


> Thanks.
>
>
>
>
>
>
>
>
>   		 	   		
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list