-
Notifications
You must be signed in to change notification settings - Fork 43
Possible issue with fsort when clearing sort variable #13
Copy link
Copy link
Open
Description
In testing hashsort, I found that fsort sometimes did not give me an identical data set compared to sort, stable. I cannot replicate this from a blank session very easily, so here is the data that gives the issue:
local addr https://raw.githubusercontent.com/mcaceresb/stata-gtools
local path develop/src/github-issues/
use `addr'/`path'/fsort_share.dta
sort int1, stable
tempfile cmp
save `cmp'
use `addr'/`path'/fsort_share.dta
fsort int1
cf * using `cmp'The result is
. cf * using `cmp'
rsort: 1 mismatch
r(9);I believe the issue is with Andrew Maurer's trick to clear : sortedby. I got around this by setting obs to =_N + 1, manipulating the last observation, and dropping it. This way the origina data is never altered.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels