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.
orig <- tribble( ~key_id, ~num, 1, 0, 2, 2, 8, 4, 13, 2 ) sub <- tribble( ~key_id, 2, 13 )
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?