-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
join: assert that by() vars have same general type (str vs num) #2
Comments
Minimal example: * generate data
clear
* master dataset
set seed 09092019
set obs 10
gen string_id = "A"
replace string_id = "B" if _n > 5
gen number_id = int(runiform() * 2)
save temp_master_dataset, replace
* using dataset
duplicates drop
gen usingvar = "BLA" * (number_id + 1)
tostring number_id, gen(number_id_tostring)
save temp_using_dataset, replace
use master, clear
* error when joining
join, from(temp_using_dataset) by(string_id number_id)
* case with no error when using only strings
tostring number_id, gen(number_id_tostring)
join usingvar, from(temp_using_dataset) by(string_id number_id_tostring) Thank you for the package! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EG:
The text was updated successfully, but these errors were encountered: