hi friends ,
ı have a "while loop". it starts from 1 then goes to 20 and creates different dataframes. in this process ı want to attend loop value to red circled areas. ı do some of them ı put "i" value in code but ı don't know how can ı do others. ı need some help. thanks.
i <- 1
while (i < 20) {
OFFICE_1 <- MAIN_OFFICE |> select(c(1,2,7)) |> filter(PLACE == i)
OFFICE_1$PLACE[OFFICE_1$PLACE == i ] <- OFFICE_1$OFFICE
colnames(OFFICE_1)[3] <- "1.OFFICE"
OFFICE_1 <- OFFICE_1[ -c(1) ]
OFFICE_1 <- as.data.frame(OFFICE_1)
i = i+1
}