Table output in shiny

Could you tell me the way to do so:
It is necessary to take an object from the top of the first table, which is displayed, in the table with clusters find in which cluster the object is, take these clusters out of there and on some principle output