2

I am trying to create a pdf inside a folder with a special character and I have an error and I have no idea why. I can create the folder with the special character as well as write tables inside the folder (using write.table) but I can not create pdf files. Someone has an idea what can I do to solve this problem?

library(ggplot)
> print(output_folder) 
"/Users/Name/Documents/Imperial_Airlines_Flight_201%2F8"
> file_name <- paste(output_folder,"/","test.pdf", sep="")
pdf(file_name,width = 20, height=10)  

qplot(gear, mpg, data=mtcars, geom=c("boxplot", "jitter"), 
      fill=gear, main="Mileage by Gear Number",
      xlab="", ylab="Miles per Gallon")

dev.off()

I can not modify the name of the folder.

Thanks a lot for any help.

ruthy_gg
  • 337
  • 3
  • 11
  • The error I get is Error in pdf(file_name, width = 20, height = 10) : Error in pdf("/Users/Name/Documents/time_series/Imperial_Airlines_Flight_201%2F8/test.pdf", : invalid 'file' argument '/Users/Name/Documents/Imperial_Airlines_Flight_201%2F8/test.pdf' – ruthy_gg Feb 05 '16 at 16:54
  • I have tried playing with getwd and setwd and it works but I guess it is a very bad approach, specially if I am using a loop to save files in different folders. – ruthy_gg Feb 05 '16 at 17:15
  • See http://stackoverflow.com/questions/13210589/changing-to-2f-in-url-doesnt-work And after you solve that OS filesystem issue, you appear headed toward another instance of FAQ 7.22 – IRTFM Feb 05 '16 at 19:20

0 Answers0