Oops! Good catch. I have been coding in python and R recently and now I'm
mixing conventions ... R's automatic line wrapping and Python's
auto-catenation given a line wrap (via '\').
A better solution would be:
a <- paste("reaaaaaaaaaaaaaaaallllllllyyyyy looooo",
"ooooooooong chaaaaaaaaarrr", sep = "")
print(a)
--------------------------------------
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
[email protected] wrote on 01/10/2011 09:51:28 AM:
> [image removed]
>
> Re: [R] how to wrap a long line in R scripts?
>
> Keith Jewell
>
> to:
>
> r-help
>
> 01/10/2011 09:54 AM
>
> Sent by:
>
> [email protected]
>
>
> "Jonathan P Daily" <[email protected]> wrote in message
>
news:of588e803b.869e9aff-on85257814.004d298d-85257814.004d4...@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
>
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.