authors_file <- file.path(R.home("doc"), "AUTHORS")
data <- readLines(authors_file)
# Trying to use connections throws an error
con <- file(authors_file)
try(readLines(con))
close(con)
# Trying to use unsupported args throws a warning
data <- readLines(authors_file, encoding = "UTF-16")
Run the code above in your browser using DataLab