On 4/7/2008 11:29 AM, Matthew.Cook at warwick.ac.uk
wrote:> Thanks Duncan,
>
> I only installed R this morning so it has taken me a while to get used to
> the coding.
> Having found and installed the rjl_0.77 zipped file into R, the problem
> still occurs. The plot is being used in correspondence analysis. The rjl
> library is called in a function "corr" as follows:
>
> ## If a 3D plot is requested ##
> library(rgl)
> plot3d(0, 0, 0, type = "n", box = FALSE, xlim = range(.......
> etc....
>
> Once the plot is created, I save it as an R image and here is the error:
>
>> save.image("C:\\Users\\Matt\\Documents\\sltable")
>>
rgl.snapshot("C:\\Users\\Matt\\Documents\\sltable",fmt="png",top="TRUE")
> Error in rgl.bringtotop() : failed
A few things:
- save.image has nothing to do with rgl or graphics; it's a way to
save a binary image of all the R objects in your session. But it should
be harmless.
- I think the problem you had is simply that you put quotes around
"TRUE". rgl.snapshot is expecting a logical value, not a character
value, and it confuses rgl.bringtotop to see the characters.
- If you say you want the file to be named sltable, that's what you'll
get, and Windows won't know that it's a png file. You should name it
sltable.png instead. (Oh, how I wish Windows explorer would by default
display filenames correctly, rather than suppressing the extension. If
you want this, in XP you open a folder in Explorer, choose Tools |
Folder options... | View from the menu and dialog tab, and clear the
check beside "Hide extensions for known file types". Then click on
the
"Apply to all folders" button. I've no idea what related
abominations
are in Vista. )
Duncan Murdoch
>
> I hope this is useful and thank you very much for your previous reply.
>
> Matt
>
>
>
>
>> On 4/7/2008 9:50 AM, Matthew.Cook at warwick.ac.uk wrote:
>>> Hi,
>>>
>>> I am an R beginner and wish to create some 3d plots. I have managed
to
>>> install the rgl library and save 3d plots, but only as an R file. I
wish
>>> to use rgl.snapshot so I can create a ".png" file and the
plot can be
>>> used
>>> in LaTex.
>>> The function rgl.snapshot does not work (i get an error
"failed"
>>> message).
>>> Having looked at previous posts, I believe that the problem can
sorted
>>> using the rgl_0.70.552.tar.gz file.
>>>
>>> Having downloaded this file, i am unsure of how to load it into the
R
>>> package (I am a Windows Vista user).
>>>
>>> Any help would be greatly appreciated.
>>
>> Installing rgl from source on Windows is tricky, because it depends on
>> several external libraries. But the version on CRAN is much newer than
>> 0.70.552, so I'd recommend trying the binary from there before
going
>> back a full year to an unreleased test version. If you have a problem
>> with rgl.snapshot in 0.77, please simplify and the code you used to a
>> line or two illustrating the problem, and mail it to or this list.
>>
>> Duncan Murdoch
>>
>> ______________________________________________
>> 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.
>>