When using add_circle_layer() with cluster_options(), the function creates three layers: "id", "id-clusters", and "id-cluster-count".
To update the data reactively in a Shiny application without tearing down the layers, do not re-run add_circle_layer(). Instead, use set_source() to replace the underlying data, which triggers Mapbox/MapLibre to re-cluster automatically:
mapboxgl_proxy("map") |> set_source(layer_id = "circles", source = filtered())
If you need to remove a clustered layer entirely (for example, before switching map backends), you must pass the full trio of layer IDs to clear_layer():
clear_layer(proxy, c("circles", "circles-clusters", "circles-cluster-count"))