Indentation for R inside functions seems to be broken for pipes and '+'s:

f <- function(something){
    mutate(something, l="aaaa") %>%
        select(l) %>%
            str_replace("a", "A") %>%

The same happens with ggplot.

Is there anyway of fixing this behavior?

  • 1
    Your ess-version is probably older than 15.09. Newer versions default to proper indentation with ess-offset-continued set to straight.
    – mutbuerger
    Commented Dec 7, 2016 at 21:38
  • Indeed, thanks. Please post this as an answer so I can mark this as resolved. Commented Dec 7, 2016 at 23:18

1 Answer 1


Your ess-version is probably older than 15.09. 15.09 came with a redesigned indentation engine and better defaults in ess-styles-alist. The relevant part for straight indentation is ess-offset-continued that is set to straight for all available styles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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