write_lines function

Write Lines to a File

Write Lines to a File

Write text lines to a file.

write_lines(text, path, gz = FALSE)

Arguments

  • text: 'character' vector. Text to write to file.
  • path: 'character' string. Path to the file.
  • gz: 'logical' flag. Whether to compress the file using Gzip. The .gz extension is added to the file path.

Returns

Invisibly returns the extracted path(s).

Examples

path <- write_lines( text = "Test", path = tempfile(fileext = ".txt"), gz = TRUE ) unlink(path)

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center