I want to pick up s subset based on one of its column existing in one other data frame. For example, I want to pick a subset from orig based on that ''key_id'' existed in "sub". Because the real data sample is large, I want an efficient way to achieve it.
My second question is about viewing a data.frame: the left column of treat is not show as 1,2,3... but instead, it is shown as 3,9, 10 and so on. Is there any way to make it looks normal?
What you see in View is that your original dataset contains rownames that are simply integers 1 to number of rows. You can convert them to explicit column with tibble::rownames_to_column command and then do with them what you need.