I would like to know how can I change indentation in emacs ess. I generally like default one (ess-set-style 'C++ 'quiet) But sometimes it formats really weirdly. For example this is what I would like to have, and this will be default formatting if it is not part of the function:
ggplot(data = overtime.by.month,
aes(x="",
y=Percent,
fill = Overtime)) +
geom_bar(width = 1) +
xlab('') +
ylab(sub.txt) +
labs(title = title.txt) +
facet_wrap(~Year.Month) +
geom_text(aes(y = txt.pos, label = Per.txt)) +
coord_polar(theta = "y") +
scale_fill_manual(values = c('green', 'red')) +
theme(axis.ticks = element_blank(),
axis.text.y = element_blank(),
axis.text.x = element_blank())
This is what I get with current indentation style, if I put it inside of the function.
a <- function(){
a <- ggplot(data = overtime.by.month,
aes(x="",
y=Percent,
fill = Overtime)) +
geom_bar(width = 1) +
xlab('') +
ylab(sub.txt) +
labs(title = title.txt) +
facet_wrap(~Year.Month) +
geom_text(aes(y = txt.pos, label = Per.txt)) +
coord_polar(theta = "y") +
scale_fill_manual(values = c('green', 'red')) +
theme(axis.ticks = element_blank(),
axis.text.y = element_blank(),
axis.text.x = element_blank())
}
UPDATE: I followed both VitoshKa's and Dirk's suggestions, after reinstallation, and updating .emacs problem went away. Thank you guys
UPDATE2: Problem is back. I think now it will be reproducible for all. I tried to on two different machines. It happens when you put code inside of the function. I updated post to reflect changes.