File (System, Transfer, Storage) in R
See also: system.file {base} to finds the full file names of files in packages etc.
R.home(component = "home")
[1] "C:\\Users\\gerard\\Documents"
path.expand("~")
[1] "C:\\Users\\gerard\\Documents"
Example:
> getwd()
[1] "C:/Users/gerard/Documents"
> setwd("C:/Users/gerard/Desktop")
tempDir <- tempdir()
tempFile <- paste0(tempDir , "/temp.txt")
temp_csv <- tempfile(fileext = ".csv")
File is a function to create, open and close a file.
file(
description = "",
open = "",
blocking = TRUE,
encoding = getOption("encoding"),
raw = FALSE
)
where:
dir()
See R Admin - OS (Platform, Sys, )
.Platform$file.sep
[1] "/"