Reputation: 285
I am trying to open a device, but getting the following error:
> trellis.device(device="pdf", filename="runtime.pdf")
Error in device.call(...) : unused argument (filename = "runtime.pdf")
The same error does occur when I try to open a device with
pdf(filename="c:/R/FSM/runtime.pdf")
Is there a package that I need to load into the library?
Upvotes: 2
Views: 2075
Reputation: 1928
The correct argument is file
rather than filename
, as in pdf(file = "myfile.pdf")
. Other functions that open new devices do use the filename
argument, such as jpeg()
, so you need to check the help file. In general, the error that was returned Error in ...: unused argument
indicates that an argument supplied in the function call is not part of the function.
Upvotes: 5