I'm trying to create a data file (data.file
).
I have a string: string=c("test1","test2","test3")
which I need to combine with some other commands and write to a text file. string
can be of any length.
In this specific case, the output I want in my data file is:
: "test1" "test2" "test3" :=
I tried cat(':',string,':=\n',file=data.file,append=TRUE)
but this isn't returning the quotation marks that I need.
(It returns : test1 test2 test3 :=
which is missing the quotation marks) .
How could I do this? And, can it also be done with writeLines
?