Stange message with getOption("device") in OSX
1
0
Entering edit mode
@-m-gonzalo-claros-diaz-2184
Last seen 10.2 years ago
Hallo people, I have just updated my R to v2.9.0 in my OSX and I have obtained an strange message. When I try to get which is my device with the command that worked fine previously getOption("device") I get very strange "device". I get the following "code" instead of a variable: function (title, width, height, pointsize, family, fontsmooth, antialias, type, file = NULL, bg, canvas, dpi) { new <- list() if (!missing(title)) new$title <- title if (!missing(width)) new$width <- width if (!missing(height)) new$height <- height if (!missing(pointsize)) new$pointsize <- pointsize if (!missing(family)) new$family <- family if (!missing(fontsmooth)) new$fontsmooth <- fontsmooth if (!missing(antialias)) new$antialias <- antialias if (!missing(bg)) new$bg <- bg if (!missing(canvas)) new$canvas <- canvas if (!missing(type)) new$type <- type if (!missing(dpi)) new$dpi <- dpi if (!checkIntFormat(new$title)) stop("invalid 'title'") if (!is.null(file) && !checkIntFormat(file)) stop("invalid 'file'") d <- check.options(new, name.opt = ".quartz.Options", envir = .Quartzenv) .External(CQuartz, d$type, file, d$width, d$height, d$pointsize, d$family, d$antialias, d$fontsmooth, d$title, d$bg, d$canvas, if is.na(d$dpi)) NULL else d$dpi) invisible() } <environment: namespace:grdevices=""> Of course, option("device") returns the same message, although the rest of the options() are fine. And I can of course open x11() and quartz() graphics windows without any problem Can someone explain why I have not the right answer? Gonzalo $> sessionInfo() R version 2.9.0 (2009-04-17) i386-apple-darwin8.11.1 locale: es_ES.UTF-8/es_ES.UTF-8/C/C/es_ES.UTF-8/es_ES.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base -- ?Donde me he equivocado, soy el ?nico responsable; donde no, el m?rito es de los que me han ayudado? ================================================================ M. Gonzalo CLAROS claros at uma.es Dpt. Biolog?a Molecular y Bioqu?mica Facultad de Ciencias Fax: (+34) 95 213 2041 Universidad de M?laga Tel: (+34) 95 213 7284/7653 E-29071 M?laga (Spain) http://www.bmbq.uma.es/fmp/
• 1.5k views
ADD COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 10 weeks ago
United States
from the manual page for getOption: 'device': a character string giving the name of a function, or the function object itself, which when called creates a new graphics device of the default type for that session. The value of this option defaults to the normal screen device (e.g., 'X11', 'windows' or 'quartz') for an interactive session, and 'pdf' in batch use or if a screen is not available. If set to the name of a device, the device is looked for first from the global environment (that is down the usual search path) and then in the 'grDevices' namespace. The default values in interactive and non-interactive sessions are configurable via environment variables 'R_INTERACTIVE_DEVICE' and 'R_DEFAULT_DEVICE' respectively. note -- 'or the function object itself' what exactly is the problem? 2009/5/18 "M. Gonzalo Claros Díaz" <claros@uma.es> > Hallo people, > > I have just updated my R to v2.9.0 in my OSX and I have obtained an strange > message. When I try to get which is my device with the command that worked > fine previously > > getOption("device") > > I get very strange "device". I get the following "code" instead of a > variable: > function (title, width, height, pointsize, family, fontsmooth, > antialias, type, file = NULL, bg, canvas, dpi) > { > new <- list() > if (!missing(title)) > new$title <- title > if (!missing(width)) > new$width <- width > if (!missing(height)) > new$height <- height > if (!missing(pointsize)) > new$pointsize <- pointsize > if (!missing(family)) > new$family <- family > if (!missing(fontsmooth)) > new$fontsmooth <- fontsmooth > if (!missing(antialias)) > new$antialias <- antialias > if (!missing(bg)) > new$bg <- bg > if (!missing(canvas)) > new$canvas <- canvas > if (!missing(type)) > new$type <- type > if (!missing(dpi)) > new$dpi <- dpi > if (!checkIntFormat(new$title)) > stop("invalid 'title'") > if (!is.null(file) && !checkIntFormat(file)) > stop("invalid 'file'") > d <- check.options(new, name.opt = ".quartz.Options", envir = > .Quartzenv) > .External(CQuartz, d$type, file, d$width, d$height, d$pointsize, > d$family, d$antialias, d$fontsmooth, d$title, d$bg, d$canvas, > if is.na(d$dpi)) NULL else d$dpi) > invisible() > } > <environment: namespace:grdevices=""> > > > Of course, option("device") returns the same message, although the rest of > the options() are fine. And I can of course open x11() and quartz() graphics > windows without any problem > > Can someone explain why I have not the right answer? > > Gonzalo > > $> sessionInfo() > R version 2.9.0 (2009-04-17) > i386-apple-darwin8.11.1 > > locale: > es_ES.UTF-8/es_ES.UTF-8/C/C/es_ES.UTF-8/es_ES.UTF-8 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > > -- > «Donde me he equivocado, soy el único responsable; donde no, > el mérito es de los que me han ayudado» > ================================================================ > M. Gonzalo CLAROS claros@uma.es > Dpt. Biología Molecular y Bioquímica > Facultad de Ciencias Fax: (+34) 95 213 2041 > Universidad de Málaga Tel: (+34) 95 213 7284/7653 > E-29071 Málaga (Spain) http://www.bmbq.uma.es/fmp/ > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > -- Vincent Carey, PhD Biostatistics, Channing Lab 617 525 2265 [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
El 18/05/2009, a las 16:11, Vincent Carey escribió: > note -- 'or the function object itself' > > what exactly is the problem? The problem is that I always (at least until now) checked which is the graphical interface with getOption("device") and I always had the "quartz" or "windows" answer. Then, I used it with get() to open the graphical window, like get(getOption("device")) because I want to open graphical windows in any platform [and not with x11() function] In "Devices{grDevices}" it is said: "Which device is given by options("device") which is initially set as the most appropriate for each platform" Hence, if in R 2.9.0 options("device") it returns the function, that means that it is not set to any device. So, which is the best method to open the graphical capability of your machine? None of these works: get(getOption("bitmapType")) nor get("quartz") But quartz() or x11() open the graphical window without any problem. If I try dev.list() it returns NULL. But capabilities("aqua") renders TRUE. So... how can I open a graphical window in any computer with the same script without using x11() ? Gonzalo -- «Donde me he equivocado, soy el único responsable; donde no, el mérito es de los que me han ayudado» ================================================================ M. Gonzalo CLAROS claros@uma.es Dpt. Biología Molecular y Bioquímica Facultad de Ciencias Fax: (+34) 95 213 2041 Universidad de Málaga Tel: (+34) 95 213 7284/7653 E-29071 Málaga (Spain) http://www.bmbq.uma.es/fmp/ [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
this is surely not an issue with Bioconductor. however, you can do something like z = getOptions("device") if (is.function(z)) z() # starts x11 on my mac running from commandline 2009/5/18 "M. Gonzalo Claros Díaz" <claros@uma.es> > > El 18/05/2009, a las 16:11, Vincent Carey escribió: > > note -- 'or the function object itself' > > what exactly is the problem? > > > The problem is that I always (at least until now) checked which is the > graphical interface with > getOption("device") > > and I always had the "quartz" or "windows" answer. Then, I used it with > get() to open the graphical window, like > > get(getOption("device")) > > because I want to open graphical windows in any platform [and not with > x11() function] > > In "Devices{grDevices}" it is said: "Which device is given by options > ("device") which is initially set as the most appropriate for each > platform" > > Hence, if in R 2.9.0 options("device") it returns the function, that means > that it is not set to any device. So, which is the best method to open the > graphical capability of your machine? None of these works: > > get(getOption("bitmapType")) > > nor > > get("quartz") > > But > > quartz() or x11() > > open the graphical window without any problem. > > If I try > > dev.list() > > it returns NULL. But > > capabilities("aqua") > > renders TRUE. > > > So... how can I open a graphical window in any computer with the same > script without using x11() ? > > Gonzalo > -- > «Donde me he equivocado, soy el único responsable; donde no, > el mérito es de los que me han ayudado» > ================================================================ > M. Gonzalo CLAROS claros@uma.es > Dpt. Biología Molecular y Bioquímica > Facultad de Ciencias Fax: (+34) 95 213 2041 > Universidad de Málaga Tel: (+34) 95 213 7284/7653 > E-29071 Málaga (Spain) http://www.bmbq.uma.es/fmp/ > > > > -- Vincent Carey, PhD Biostatistics, Channing Lab 617 525 2265 [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Hi Gonzalo, how about using dev.new(): 'dev.new' opens a new device. Normally R will open a new device automatically when needed, but this enables you to open further devices in a platform-independent way. (For which device is used see 'getOption("device")'.) Florian On 18.05.2009, at 09:14, Vincent Carey wrote: > this is surely not an issue with Bioconductor. however, you can do > something like > > z = getOptions("device") > if (is.function(z)) z() # starts x11 on my mac running from > commandline > > 2009/5/18 "M. Gonzalo Claros D?az" <claros at="" uma.es=""> > >> >> El 18/05/2009, a las 16:11, Vincent Carey escribi?: >> >> note -- 'or the function object itself' >> >> what exactly is the problem? >> >> >> The problem is that I always (at least until now) checked which is >> the >> graphical interface with >> getOption("device") >> >> and I always had the "quartz" or "windows" answer. Then, I used it >> with >> get() to open the graphical window, like >> >> get(getOption("device")) >> >> because I want to open graphical windows in any platform [and not >> with >> x11() function] >> >> In "Devices{grDevices}" it is said: "Which device is given by options >> ("device") which is initially set as the most appropriate for each >> platform" >> >> Hence, if in R 2.9.0 options("device") it returns the function, >> that means >> that it is not set to any device. So, which is the best method to >> open the >> graphical capability of your machine? None of these works: >> >> get(getOption("bitmapType")) >> >> nor >> >> get("quartz") >> >> But >> >> quartz() or x11() >> >> open the graphical window without any problem. >> >> If I try >> >> dev.list() >> >> it returns NULL. But >> >> capabilities("aqua") >> >> renders TRUE. >> >> >> So... how can I open a graphical window in any computer with the same >> script without using x11() ? >> >> Gonzalo >> -- >> ?Donde me he equivocado, soy el ?nico responsable; donde no, >> el m?rito es de los que me han ayudado? >> ================================================================ >> M. Gonzalo CLAROS claros at uma.es >> Dpt. Biolog?a Molecular y Bioqu?mica >> Facultad de Ciencias Fax: (+34) 95 213 2041 >> Universidad de M?laga Tel: (+34) 95 213 7284/7653 >> E-29071 M?laga (Spain) http://www.bmbq.uma.es/fmp/ >> >> >> >> > > > -- > Vincent Carey, PhD > Biostatistics, Channing Lab > 617 525 2265 > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY

Login before adding your answer.

Traffic: 507 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6