How do I save the vector n into a file called <02_exercises_vector3.txt> such that each letter is on one line? I just need some help understanding this. I am brand new to R and am trying to get a base understanding but it is very difficult.
1 Answer
$\begingroup$
$\endgroup$
For instance, using cat
with the file
parameter:
> n <- letters[1:10]
> n
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
> cat(n,file="foo.txt",sep="\n")
Look at ?cat
.