Implementation of r_set_select()

Targets #176
What is the connection to r_set_select?