Grokbase Groups R r-help October 2015
I all you are doing is matching a single column and then extracting rows
that match, then the '%in%' operator should work:

indx <- reg6idGlobal$alloc_key %in% req6id_subsample_key$alloc_key
my_subset <- reg6idGlobal[indx, ]

Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

On Mon, Oct 19, 2015 at 6:19 AM, John Wasige wrote:

?Hi, I need help on how to sub-sample my data in R. I have two tables, one
table with global dataset and another with a list of codes for sub sample
the global dataset.

Download link


?All these tables have a column called: alloc_key. I want to use the list
of codes in reg6id_subsample_key.csv to extract all raws from
reg6idGlobal.csv for matching/ similar codes in column alloc_key of
reg6idGlobal.csv file.

?Somebody with an idea on how I can go about doing this?

Thanks for your help



[[alternative HTML version deleted]]

R-help at mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.

  [[alternative HTML version deleted]]

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
Discussion Overview
groupr-help @
postedOct 19, '15 at 10:19a
activeOct 19, '15 at 2:04p



site design / logo © 2018 Grokbase