3

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") %>%
                tolower()
}

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 Dec 7 '16 at 21:38
  • Indeed, thanks. Please post this as an answer so I can mark this as resolved. – Matías Guzmán Naranjo Dec 7 '16 at 23:18
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, privacy policy and cookie policy

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