filetype: character. A file format associated with a GDAL "driver" such as "ESRI Shapefile". See gdal(drivers=TRUE) or the GDAL docs. If NULL it is attempted to guess the filetype from the filename extension
layer: character. Output layer name. If NULL the filename is used
insert: logical. If TRUE, a new layer is inserted into the file, or an existing layer overwritten (if overwrite=TRUE), if the format supports it (e.g. GPKG allows that). See vector_layers to remove a layer
overwrite: logical. If TRUE and insert=FALSE, filename is overwritten if the file format and layer structure permits it. If TRUE and insert=TRUE, only the target layer is overwritten if the format supports it (e.g. GPKG).
options: character. Format specific GDAL options such as "ENCODING=UTF-8". Use NULL or "" to not use any options