[R] how to wrap a long line in R scripts?
Keith Jewell
k.jewell at campden.co.uk
Mon Jan 10 15:51:28 CET 2011
"Jonathan P Daily" <jdaily at usgs.gov> wrote in message
news:OF588E803B.869E9AFF-ON85257814.004D298D-85257814.004D4FB5 at usgs.gov...
>a <- "reaaaaaaaaaaaaaaaallllllllyyyyy looooo
> ooooooooong chaaaaaaaaarrr"
>
> Although the indentation is just personal preference.
> --------------------------------------
> Jonathan P. Daily
> Technician - USGS Leetown Science Center
> 11649 Leetown Road
> Kearneysville WV, 25430
> (304) 724-4480
> "Is the room still a room when its empty? Does the room,
> the thing itself have purpose? Or do we, what's the word... imbue it."
> - Jubal Early, Firefly
>
Did you test that? Printing a to see the result so the commands are
-------------
a <- "reaaaaaaaaaaaaaaaallllllllyyyyy looooo
ooooooooong chaaaaaaaaarrr"
a
----------------------------
Pasting directly into Rgui
> a <- "reaaaaaaaaaaaaaaaallllllllyyyyy looooo
+ ooooooooong chaaaaaaaaarrr"
> a
[1] "reaaaaaaaaaaaaaaaallllllllyyyyy looooo\n ooooooooong
chaaaaaaaaarrr"
Saving to file 'test.r' and sourcing
> source("C:\\Documents and Settings\\jewell\\Desktop\\test.r", echo=TRUE)
> a <- "reaaaaaaaaaaaaaaaallllllllyyyyy looooo
+ ooooooooong chaaaaaaaaarrr"
> a
[1] "reaaaaaaaaaaaaaaaallllllllyyyyy looooo\n ooooooooong
chaaaaaaaaarrr"
I don't think this is what the OP wanted.
I guess he wants "reaaaaaaaaaaaaaaaallllllllyyyyy loooooooooooooong
chaaaaaaaaarrr"
I don't know the answer (other than, as suggested by Peter Ehlers") to build
it bit by bit.
KJ
More information about the R-help
mailing list