util_txt2file: Text to File

Description Usage Arguments Author(s) Examples

View source: R/util_txt2file.R

Description

Writes lines of character strings to file.

Usage

1
util_txt2file(text, dir, fn, msg = NULL, overwrite = FALSE)

Arguments

text

A character vector

dir

Character string. Directory.

fn

Character string. Filename.

msg

Character string. Optional message. If supplied, prints msg dir/fn.

overwrite

Logical. Overwrite existing fn in dir.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
text <- paste0(
  "Lorem ipsum dolor sit amet,",
  "consectetur adipiscing elit,",
  "sed do eiusmod tempor incididunt",
  "ut labore et dolore magna aliqua.",
  "Ut enim ad minim veniam,",
  "quis nostrud exercitation ullamco laboris nisi",
  "ut aliquip ex ea commodo consequat.",
  "Duis aute irure dolor in reprehenderit in voluptate velit",
  "esse cillum dolore eu fugiat nulla pariatur.",
  "Excepteur sint occaecat cupidatat non proident,",
  "sunt in culpa qui officia deserunt mollit anim id est laborum."
)
util_txt2file(
  text = text,
  dir = getwd(),
  fn = "Lipsum.txt",
  msg = "Output file:"
)

## End(Not run)

jeksterslabds/jeksterslabRutils documentation built on Jan. 18, 2021, 11:41 p.m.