1

How can I use something like readLines to save the file as a character string in my environment with its own file name as the variable?

I tried something like the pseudocode below without success.

paste(filename) <- readLines(filename)
hmnoidk
  • 545
  • 6
  • 20

1 Answers1

1

assign function could be an alternative:

assign("filename", readLines("filename"))

if your filename starts with a character different from a to z (e.g. ., _), you can always call your variable circumscribed with `` symbols

Ulises Rosas-Puchuri
  • 1,900
  • 10
  • 12