0
$\begingroup$

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.

$\endgroup$

1 Answer 1

1
$\begingroup$

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.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.