I ran the following script from xyplot Examples using Tin-R on Windows and saw no plot produced. EE <- equal.count(ethanol$E, number=9, overlap=1/4) xyplot(NOx ~ C | EE, data=ethanol, prepanel = function(x,y) prepanel.loess(x, y, span=1), xlab="Compression Ratio", ylab="NOx (micrograms/J)", panel = function(x,y) { panel.grid()(h = -1, v=2) panel.xyplot(x,y) panel.loess(x,y, span=1) }, aspect = "xy") The Rgui showed> source(.trPaths[5])Without any error msg. Did I miss anything? Please enlighten me. Richard [[alternative HTML version deleted]]
On Jul 12, 2010, at 6:26 PM, YANG, Richard ChunHSi wrote:> I ran the following script from xyplot Examples using Tin-R on > Windows and saw no plot produced. > > EE <- equal.count(ethanol$E, number=9, overlap=1/4) > xyplot(NOx ~ C | EE, data=ethanol, > prepanel = function(x,y) prepanel.loess(x, y, span=1), > xlab="Compression Ratio", ylab="NOx (micrograms/J)", > panel = function(x,y) { > panel.grid()(h = -1, v=2) > panel.xyplot(x,y) > panel.loess(x,y, span=1) > }, > aspect = "xy") > > The Rgui showed >> source(.trPaths[5]) > > Without any error msg. Did I miss anything? Please enlighten me.I got the example to work fine but had no plotting with your version and cannot see the difference in the code. I assigned them to t1 nd t2 and ... > all.equal(t1, t2) [1] "Component 5: target, current do not match when deparsed" [2] "Component 29: target, current do not match when deparsed" Looking at str applied to both does not illuminate me. I have seen problems on my Mac with examples copied from the help page and I suspect there is some invisible character sitting in a copy-pasted version that out mail-clients are not displaying. What happens if you try: examples(xyplot) #??? -- David Winsemius, MD West Hartford, CT
You missed FAQ 7.22 7.22 Why do lattice/trellis graphics not work? The most likely reason is that you forgot to tell R to display the graph. Lattice functions such as xyplot() create a graph object, but do not display it (the same is true of *ggplot2* graphics, and Trellis graphics in S-Plus). The print() method for the graph object produces the actual display. When you use these functions interactively at the command line, the result is automatically printed, but in source() or inside your own functions you will need an explicit print() statement. The FAQ on R and the separate FAQ on R for Windows are both accessible from the Help menu item on the R Console on the R GUI. [[alternative HTML version deleted]]