Мы можем использовать .GRP
из data.table
после группировки по «Дата», «Местоположение»
library(data.table)
setDT(df)[, Combo := .GRP, .(Date, Location)]
df
# Date Location Var1 Var2 Combo
#1: 2018 Ohio A 1 1
#2: 2018 Ohio B 2 1
#3: 2018 Arizona C 3 2
#4: 2018 Arizona D 4 2
#5: 2018 Nebraska E 5 3
#6: 2017 Nebraska F 6 4
#7: 2017 New Mexico G 7 5
#8: 2016 Idaho H 8 6
<час> Или используя rleid
setDT(df)[, Combo := rleid(Date, Location)]
An add-in can do most of that. There's a template in VS2008 for creating a base add-in.
I have an add-in that you can download that hooks into the solution/project load events etc - it is free and comes with source code ( http://www.huagati.com/projectloader/download/huagatiprojectloader.zip ). This particular add-in detects when projects/solutions are loaded and pre-loads referenced assemblies to work around a CLR bug that can cause VS2008 to crash. Anyway, the source code for it shows how to detect some of the events you're looking for.
Other than that, the definitive resource on add-in development and all the little quirks and tricks involved is Carlos Quintero's blog ( http://msmvps.com/blogs/carlosq/ ) and the "howto" article series on his website ( http://www.mztools.com/resources_vsnet_addins.aspx ).
Craig Skibo's blog ( http://blogs.msdn.com/craigskibo/ ) also has some useful tips.
You want:
Buy the book, if nothing else.