[ESS] Indenting of R code, particularly dplyr code.

Patrick Connolly p_conno||y @end|ng |rom @||ng@hot@co@nz
Thu Oct 8 20:55:57 CEST 2015


I tried what was suggested by Vitalie and Lionel but they had no
effect.  After some inspection, I noticed this message:

Investigating that message, I came across the suggestion that Emacs 24
is needed for ess-15.09 to work.  Is that the case?  I seem to recall
somewhere that there were issues with Emmacs 24.  What is the story
with that?

TIA


On Wed, 07-Oct-2015 at 08:27PM +0200, Vitalie Spinu wrote:

|> 
|> ESS moved from 2 to 4 spaces some years back. Indentation was completely
|> rewritten in 15.09 and you probably should be just fine by setting default
|> styles. They all were carefully designed.
|> 
|> So, with 15.09 either
|> 
|>  (setq ess-default-style 'RStudio)
|> 
|> or
|> 
|>  (setq ess-indent-offset 2)
|> 
|> or play with more refined customization variables as Lionel suggested and as
|> described in `ess-style-alist`.
|> 
|> In all cases you will get straight indentation:
|>   
|>   neofabLast.df %>%
|>     arrange(tree, treatment) %>%
|>     group_by(treatment, tree) %>%
|>     summarise(No = mean(no), Diam = mean(diam))
|> 
|> For the cascading style set ess-offset-continued to 'cascade.
|> 
|> 
|>   Vitalie
|> 
|> 
|> >> On Wed, Oct 07 2015 11:50, Lionel Henry wrote:
|> 
|> >> On 7 oct. 2015, at 11:09, Patrick Connolly <p_connolly using slingshot.co.nz> wrote:
|> >> 
|> >> |> I guess you really should update your ESS version. The
|> >> |> indentation code got completely rewritten in the last version.
|> >> 
|> >> If I can't customize it to indent only two characters, I'll keep my
|> >> ancient version.  4 characters is too much indentation.
|> 
|> > If your global offset level is 4 and you want continuations to be
|> > indented with 2 spaces, you customise it like this :
|> 
|> > (setq ess-offset-continued '(straight 2))
|> 
|> > Lionel
|> > ______________________________________________
|> > ESS-help using r-project.org mailing list
|> > https://stat.ethz.ch/mailman/listinfo/ess-help

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___    Patrick Connolly   
 {~._.~}                   Great minds discuss ideas    
 _( Y )_  	         Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)  	                      ..... Eleanor Roosevelt
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.




More information about the ESS-help mailing list