[R] Retreiving correct data from combining two datasets

John Kane jrkrideau at inbox.com
Mon Aug 5 18:07:25 CEST 2013


In Line

John Kane
Kingston ON Canada


> -----Original Message-----
> From: info at software-solutions.nl
> Sent: Mon, 5 Aug 2013 06:57:30 -0700 (PDT)
> To: r-help at r-project.org
> Subject: [R] Retreiving correct data from combining two datasets
> 
> Hi all,
> 
> I have two datasets:
> 
> Dataset 1 - List of Users, the layout looks like this:
> ID Name C1 C2 C3 ............C23 C24 C25
> 
> Dataset 2 - List of Codes, the layout looks like this:
> Code Description Category
> 
> The code fields in the user-dataset do not have to contain a value and if
> they have a value they dont have to correspond with the Codes-dataset.
> 
> Now I need 2 things:
> - Per user-record the number of occurences in the Codes table, so if one
> user would have C1, C8, C12, C19 occuring in the Codes dataset that would
> be
> 4.
> - The top 20 of the most occuring codes with their description
> 
> I find this very challenging but I'm sure there are some R-guru's out
> there
> who can help me on this:)
> I cannot give any sample data because it's classified

Make some up.  Or at least supply the results of str()  See ?str

The R-help readers don't actually care what the data is as much as they care about the format of the data.  At the moment we have no idea if the codes are numeric, character or whatever.





> 
> Thanks in advance
> 
> 
> 
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Retreiving-correct-data-from-combining-two-datasets-tp4673131.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!



More information about the R-help mailing list