# NOT RUN { tempfile(c("ab", "a b c")) # give file name with spaces in! tempfile("plot", fileext = c(".ps", ".pdf")) tempdir() # works on all platforms with a platform-dependent result # } # NOT RUN { ## Show how 'check' is working on some platforms: if(exists("I'm brave") && `I'm brave` && identical(.Platform$OS.type, "unix") && grepl("^/tmp/", tempdir())) { cat("Current tempdir(): ", tempdir(), "\n") cat("Removing it :", file.remove(tempdir()), "; dir.exists(tempdir()):", dir.exists(tempdir()), "\n") cat("and now tempdir(check = TRUE) :", tempdir(check = TRUE),"\n") } # }
Run the code above in your browser using DataCamp Workspace