You need to group by the variable that you want to use to partition and then use group_walk that applies a function to every grouping element
xxxxxxxxxx
library(dplyr)
library(readr)
mtcars %>%
group_by(cyl) %>%
group_walk(~ write_csv(.x, paste0(.y$cyl, "test.csv")))
.x is the dataframe, and y$cyl is the variable that you're using to group export.