Set R graphics parameters locally but not globally?

shadowtalker

Is there a way to set or mask par() in a local environment? I'm not terribly familiar with R environments so I'm not clear on why this wouldn't be possible, although I definitely understand why it isn't the default behavior. I saw this question but I don't know enough to know whether it applies here. I'd also be surprised if there isn't some way to tweak the search path to get it to work.

Then again, there's no way to tweak the algorithm that decides whether to omit some of your axis labels... would it be so hard to just have a switch to turn the feature off and let users pay the price? That seems to have been the design philosophy for everything else in the language (and I'm kind of starting to appreciate it).

Greg Snow

In addition to the other answer(s) and comments, note that graphical parameters are local to the graphics device, so you can open a new graphics device, set the parameters you want, then when you are through close the device (or switch back to the other one) and the previous parameters will be in effect. A quick example:

dev.new()
par(col='blue')
hist(rnorm(100))
abline(v=0, lwd=5)
dev.new()
par(col='red')
hist(rnorm(1000))
par(lwd=5)
abline(v=0)
dev.off()
plot(runif(25), rnorm(25))
abline(h=0, lwd=3)

See the help for dev.list and dev.set for details on switching between graphics devices.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to tell if npm package was installed globally or locally

From Java

Why do we need to install gulp globally and locally?

From Dev

Set Font globally in JavaFX

From Dev

Locally installed versus globally installed NPM modules

From Dev

Declare class object globally but without parameters

From Dev

How do I set Jasper init parameters globally for all servlets in Tomcat's web.xml?

From Dev

Is it possible to set qmake debug globally?

From Dev

How to set R command line parameters in StatET

From Dev

Set default values for function parameters in R

From Dev

Install a locally developed npm package globally

From Dev

Fabric set environment variable globally

From Dev

Set directives options globally

From Dev

postcss-cli: using locally vs globally installed postcss modules

From Dev

npm module install locally only if not available globally

From Dev

Set isolation level in Yii globally

From Dev

Aliases in scripts are not set globally

From Dev

How to set umask globally?

From Dev

Fetching both locally and globally installed nodejs modules

From Dev

Apache for php working locally but not globally - Windows

From Dev

Fabric set environment variable globally

From Dev

npm module install locally only if not available globally

From Dev

Missing error when assigning locally to a variable that doesn't exist locally but does globally

From Dev

Java parameters in graphics

From Dev

Installing gulp plugins locally vs globally

From Dev

Should I declare this variable locally or globally?

From Dev

Javascript: why will variable work locally but not globally

From Dev

Updating number locally and globally in Vue 2 control

From Dev

Is there a size difference between importing a component locally or globally?

From Dev

Use function globally or locally?

Related Related

  1. 1

    How to tell if npm package was installed globally or locally

  2. 2

    Why do we need to install gulp globally and locally?

  3. 3

    Set Font globally in JavaFX

  4. 4

    Locally installed versus globally installed NPM modules

  5. 5

    Declare class object globally but without parameters

  6. 6

    How do I set Jasper init parameters globally for all servlets in Tomcat's web.xml?

  7. 7

    Is it possible to set qmake debug globally?

  8. 8

    How to set R command line parameters in StatET

  9. 9

    Set default values for function parameters in R

  10. 10

    Install a locally developed npm package globally

  11. 11

    Fabric set environment variable globally

  12. 12

    Set directives options globally

  13. 13

    postcss-cli: using locally vs globally installed postcss modules

  14. 14

    npm module install locally only if not available globally

  15. 15

    Set isolation level in Yii globally

  16. 16

    Aliases in scripts are not set globally

  17. 17

    How to set umask globally?

  18. 18

    Fetching both locally and globally installed nodejs modules

  19. 19

    Apache for php working locally but not globally - Windows

  20. 20

    Fabric set environment variable globally

  21. 21

    npm module install locally only if not available globally

  22. 22

    Missing error when assigning locally to a variable that doesn't exist locally but does globally

  23. 23

    Java parameters in graphics

  24. 24

    Installing gulp plugins locally vs globally

  25. 25

    Should I declare this variable locally or globally?

  26. 26

    Javascript: why will variable work locally but not globally

  27. 27

    Updating number locally and globally in Vue 2 control

  28. 28

    Is there a size difference between importing a component locally or globally?

  29. 29

    Use function globally or locally?

HotTag

Archive