# Conditional Function in R [closed]

I have an R function for (i in 1:10) that reads in data and performs some cleaning. Is it possible to write a flexible statement to execute certain parts of the code conditionally, for example have different steps for i = 2 and 8?

• Hi, welcome to the forum. Your question is very vague. Please add more details in future questions and make sure you describe your problem in a good way. – Peter Aug 14 at 8:10

for (i in 1:10){