Have you considered something along the lines of %in% infix operator instead of equals ==, e.g.
data.shp<- shapefile("data.shp")
ds_1234<- data.shp[data.shp$district_name %in% c("ds-01", "ds-02", "ds-03", "ds-04"), ]
alternatively using {dplyr} workflow
library(dplyr)
data_filtered <- data.shp %>%
filter(district_name %in% c("ds-01", "ds-02", "ds-03", "ds-04"))