Open the csv file (temp) that needs to be split, split and write to the flights folder, each file has 9999+1 lines:
library(arrow)
ds=open_dataset("temp.csv",format="csv")
write_dataset(ds,"flights",format="csv",max_rows_per_file=9999)
The result is shown in the figure: