Piping syntax next line vs. current line

Good afternoon,

This isn't going to be easy for me, but I started changing my comma format.

I used to do this
theme(
plot.title = element_text(hjust = 0.5, size = 20, face = "bold"),
axis.title.x = element_text(size = 15, face = "italic"),
axis.title.y = element_text(size = 15, face = "italic"),
legend.position = "top" # Legend at the top
) +
Now I am moving to this
theme(
plot.title = element_text(hjust = 0.5, size = 20, face = "bold")
, axis.title.x = element_text(size = 15, face = "italic")
, axis.title.y = element_text(size = 15, face = "italic")
, legend.position = "top" # Legend at the top
) +

The reason I am moving in the direction is so when I comment a line, I don't have to also remove the comma in the previous line
theme(
plot.title = element_text(hjust = 0.5, size = 20, face = "bold")
, axis.title.x = element_text(size = 15, face = "italic")
, axis.title.y = element_text(size = 15, face = "italic")

#, legend.position = "top" # Legend at the top

) +
I was hoping to change my piping order to a similar format. However, as you can see I get error messages.
image

Is there a setting in RStudio that can be turned on so the pipe operator could be placed on the next line?

Edit: I did find that we can use parentheses. However, is there another option besides having extra ()?

Edit2: I found the answer for why this change could break some processes in R Studio. I'm going to use parentheses moving forward.

Thank you

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.