R – Resolving Error in match.arg(type): ‘arg’ Must Be of Length 1

r

I am running this code in R:

tiff("f0ex_plot.tiff", height = 10, width = 20, units= "cm", type = c("windows", "cairo"), res = 300)

But I am receiving an error:

Error in match.arg(type) : 'arg' must be of length 1

Any help?

Best Answer

The error Error in match.arg(type) : 'arg' must be of length 1 is associated with trying to pass more than one value to an argument that only accepts a single value. You are passing two values to the type argument. Try it with:

tiff("f0ex_plot.tiff", height = 10, width = 20, units= "cm", 
     type = "windows", res = 300)
  #... do something
dev.off()
Related Question