For a sf object, this functions selects all observations that intersect any commune from a given department. For those observations it add commune and department information in the correspondent fields. If an observation intersects more than one commune, one is chosen (more or less randomously).

add_commune(x, commune, department = NULL)

Arguments

x

sf object.

commune

sf object, that describes the commune perimeters.

department

character, department that should be used.

Value

sf object with both commune and department information added.

Author

Frédéric Grelot