5 Selection

A very commonly used tool in ArcGIS is the concept of “Selection.” The idea is, that you select features from your vector dataset in one of the following three ways:

  1. Select: Interactively by clicking in your map
  2. Select By Attributes: By specifying (non-spatial) criteria based on the attribute table
  3. Select By Location: By specifying spatial criteria based on the relationship to another dataset.
A very commonly used tool: The selection tools from the ArcGIS Pro Map Pane

Figure 5.1: A very commonly used tool: The selection tools from the ArcGIS Pro Map Pane

Using the tools via these buttons 5.1 have two effects.

  1. The selected features are highlighted visually
  2. Any operation performed with a dataset that has an active selection respects this selection. In other words, the operation is only performed on the selected features.

This second effect is cause for many confusing errors, either because the user forgot that a selection was active or the there were zero elements matching the specified criteria and so the operation was performed on an empty dataset. For this reason, this type of “floating selection” is not very useful and was never implemented in R.

However, two of the three described methods to select data are supported in R, but with a different approach. The selected data leaves the original data unchanged, but must assigned to a new R object3. Interactive selection (button “Select” in 5.1 is a priori not reproducible and therefore not supported in R.

By the way: In the world of SQL this type of operation is not called “selection” but “filtering.” Consequently, that is also the name used in R. In R as well as SQL, a select is done on columns in a dataset, not on rows (i.e. if you want to retain only a subset of the columns in a dataset).

  1. or, if you are familiar with pipes, piped into a new operation↩︎