Re: [Rd] Display image in tcl/tk information window: path to file ?
Dear Ulrike, If I understand correctly what you want to do, the image file is stored in your package. If so, you can use the .path.package() function to locate your package on the file system. For example, the Rcmdr uses the following code to find its etc subdirectory: file.path(.path.package(package="Rcmdr")[1], "etc"). I hope this helps, John -- John Fox, Professor Department of Sociology McMaster University Hamilton, Ontario, Canada web: socserv.mcmaster.ca/jfox > -Original Message- > From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On > Behalf Of Ulrike Groemping > Sent: September-17-09 8:10 AM > To: r-devel@r-project.org > Subject: [Rd] Display image in tcl/tk information window: path to file ? > > > Dear DevelopeRs, > > for an R-Commander plugin, I want to display a pre-stored information image, > if the user presses a button. Everything works fine with the command > > tcl("image", "create", "photo", "MaxC2.image", file="MaxC2res3image.gif") > > for image creation, as long as the file entry refers to the correct location > of the file on my hard drive. How can I make this portable ? > > I currently have the image stored in the inst directory. "R CMD INSTALL > --build" moves it to the top directory in the zip file. I have no idea how > to tell R (or tcl) where to look for the file. Any help is appreciated! > > Best regards, > Ulrike > > * > Ulrike Groemping > BHT Berlin > > > -- > View this message in context: http://www.nabble.com/Display-image-in-tcl-tk- > information-window%3A-path-to-file---tp25490113p25490113.html > Sent from the R devel mailing list archive at Nabble.com. > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Display image in tcl/tk information window: path to file ?
?system.file for example (if the file lives in inst/images of your source package) system.file( "images", "MaxC2res3image.gif", package = "yourpackage" ) Romain On 09/17/2009 02:09 PM, Ulrike Groemping wrote: Dear DevelopeRs, for an R-Commander plugin, I want to display a pre-stored information image, if the user presses a button. Everything works fine with the command tcl("image", "create", "photo", "MaxC2.image", file="MaxC2res3image.gif") for image creation, as long as the file entry refers to the correct location of the file on my hard drive. How can I make this portable ? I currently have the image stored in the inst directory. "R CMD INSTALL --build" moves it to the top directory in the zip file. I have no idea how to tell R (or tcl) where to look for the file. Any help is appreciated! Best regards, Ulrike * Ulrike Groemping BHT Berlin -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/yw8E : New R package : sos |- http://tr.im/y8y0 : search the graph gallery from R `- http://tr.im/y8wY : new R package : ant __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Display image in tcl/tk information window: path to file ?
Dear DevelopeRs, for an R-Commander plugin, I want to display a pre-stored information image, if the user presses a button. Everything works fine with the command tcl("image", "create", "photo", "MaxC2.image", file="MaxC2res3image.gif") for image creation, as long as the file entry refers to the correct location of the file on my hard drive. How can I make this portable ? I currently have the image stored in the inst directory. "R CMD INSTALL --build" moves it to the top directory in the zip file. I have no idea how to tell R (or tcl) where to look for the file. Any help is appreciated! Best regards, Ulrike * Ulrike Groemping BHT Berlin -- View this message in context: http://www.nabble.com/Display-image-in-tcl-tk-information-window%3A-path-to-file---tp25490113p25490113.html Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel