.old_wd <- setwd(tempdir())
x <- "This is
a small
text."
# write the text to a text file
write_txt(x, "example-text-file.txt")
# read a text from file
y <- read_txt("example-text-file.txt")
y
setwd(.old_wd)
Run the code above in your browser using DataLab