formatting if statements

Your example didn't complete. See the FAQ: How to do a minimal reproducible example reprex for beginners to get help with specific code examples.

The syntax for if() is simple.

For short statements, they can be inline. For code requiring line breaks, enclose in curly brackets. ifelse() works similarly.

size <- 100
if(size >= 100) "big"
#> [1] "big"
if(size >= 100){
  foo = "really"
  bar = "big"
  paste(foo,bar)
}
#> [1] "really big"
ifelse(size >= 100,"big","small")
#> [1] "big"

Created on 2022-12-22 by the reprex package (v2.0.1)