I have variables from
b <- c(c1,c2,c3,c4,c5,c6,c7,c8,c9,
b <- c(c 1:c24)
You can do this with
c1 <- c2 <- c3 <- c4 <- 1 unlist( ## convert from list to vector lapply( paste0("c",1:4), ## names of variables get) ## retrieve variable by name ) ##  1 1 1 1
In general, it would be a good idea to look further back in your workflow and see if it's possible to generate those variables within a list in the first place ...