[R] how to wrap a long line in R scripts?

Jonathan P Daily jdaily at usgs.gov
Mon Jan 10 15:17:58 CET 2011


To elaborate, expressions and any explicit enclosures can also be simply 
split between lines. Often, this is done without space issues just for 
clarity.

EX:

vec <- c(LETTERS[1:5], 1:5,
        letters[1:5])

plot(X, Y, main = "A plot", xlab = "X Values", ylab = "Response",
        lty = 1,
        pch = 5,
        cex = .75)

num <- ((a1 + a2 + a3)/b1 + 
        (a4 + a5 + a6)/b2) / 
        b3
--------------------------------------
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

r-help-bounces at r-project.org wrote on 01/10/2011 09:04:23 AM:

> [image removed] 
> 
> Re: [R] how to wrap a long line in R scripts?
> 
> Jonathan P Daily 
> 
> to:
> 
> Tutu2008
> 
> 01/10/2011 09:09 AM
> 
> Sent by:
> 
> r-help-bounces at r-project.org
> 
> Cc:
> 
> r-help, r-help-bounces
> 
> 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
> 
> ______________________________________________
> R-help at r-project.org 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.



More information about the R-help mailing list