Vulpecula
Vulpecula

Reputation: 398

Correctly set R default graphic device to quartz?

I tried to add the following line in my .Rprofile file:

options(device = quartz)

It produced an error:

Error in options(device = quartz) : object 'quartz' not found

Then I tried:

options(device = "quartz")

And it works.

However, both work in the regular R session. Can anyone tell me what is the reason for the difference in behavior?

Upvotes: 0

Views: 2361

Answers (1)

IRTFM
IRTFM

Reputation: 263362

The erro message says it all. There is no data-object named 'quartz' and the options function is not expecting (nor can it find) a function name as an argument value for the 'device'-node.

You are seeing the effect of the environment where .Rprofile is being evaluated because some of the usual packages (such as stats or graphics) are not yet loaded. Read more about this at ?Startup. You could avoid this by starting .Rprofile with require(grDevices)

Upvotes: 3

Related Questions