# \dontshow{
.old_wd <- setwd(tempdir())
# }
write_union("a_file", letters[1:3])
readLines("a_file")
write_union("a_file", letters[1:5])
readLines("a_file")
write_over("another_file", letters[1:3])
readLines("another_file")
write_over("another_file", letters[1:3])
if (FALSE) {
## will error if user isn't present to approve the overwrite
write_over("another_file", letters[3:1])
}
## clean up
file.remove("a_file", "another_file")
# \dontshow{
setwd(.old_wd)
# }
Run the code above in your browser using DataLab