Comments (10)
Can you try updating ftools and then running ftools, compile
(and restarting Stata then).
Else, what version of stata/ftools are you running?
from ftools.
net install ftools, from(https://github.com/sergiocorreia/ftools/raw/master/src/)
I get the same error:
. sysuse auto, clear
(1978 Automobile Data)
. fsort turn
. fsort turn
st_store(): 3200 conformability error
<istmt>: - function returned error
r(3200);
Version:
. which ftools
/home/mauricio/ado/plus/f/ftools.ado
*! version 2.18.1 17sep2017
. which fsort
/home/mauricio/ado/plus/f/fsort.ado
*! version 2.9.0 28mar2017
This happens for any variable, but if it gives a clue the error for strings is different
. fsort make
. fsort make
AMC not found
r(111);
from ftools.
I just pushed an update that rewrites -fsort-.
It has three main differences:
- Now it actually uses Andrew Maurer's trick (discussed in code) that saves us the work of rearranging the dataset contents by hand
- It has checks for the corner case where the dataset is already sorted by varlist
- Instead of being faster above 10mm obs, it appears it is faster above 100k obs.
Note that I haven't done enough testing so this command is still in beta quality.
By the way Mauricio, I think that if you combine your plugin with Andrew Maurer's trick, you could end up with a sorting algorithm way faster than the current sort (and that fsort), which would be incredibly amazing (even if it is only faster when sorting categoricals)
from ftools.
The memory overhead is insane for sorting because I have to copy the data twice, so half the run-time is reading and writing the data. Stata uses no additional memory for sorts; I assume it's just doing quick-sort in place. I'll post a baby version of a sorting pluign later today so you can see what I mean.
from ftools.
The fsort
error is gone in the latest version, btw.
from ftools.
The fsort error is gone in the latest version, btw.
Cool!
so half the run-time is reading and writing the data
With the trick that the new fsort uses, you never have to copy the data, only the variables you are sorting. Then Stata does the reshuffling within Stata based on the index you provide.
from ftools.
This fails:
. sysuse auto, clear
(1978 Automobile Data)
. gen x = "some"
. sort x make
. fsort make
some not found
r(111);
I think you need, in line 24,
qui replace `sortvar' = `val' in 1
cap replace `sortvar' = `"`val'"' in 1
from ftools.
This should be fixed in the new commit; I also rewrote the code to be check the types instead of capturing all the replacements.
from ftools.
(In case you are benchmarking the program, just fixed a typo created by the previous commit, that caused fsort to create missings)
from ftools.
Ok. I haven't run benchmarks yet. I've uploaded a repo with a proof-of-concept version. It's only faster for sorting on fewer variables. Sorting on entire data-sets (if there are strings) can be slower. Anyway, the repo is up if you want to test it: https://github.com/mcaceresb/stata-qsort
from ftools.
Related Issues (20)
- fmerge error HOT 1
- data type following fcollapse HOT 1
- fcollapse with any missing weights returns all missing HOT 1
- fcollapse incorrectly parses negative weights HOT 6
- join: do not copy certain chars
- Adding update / replace to fmerge HOT 9
- join: problems with spaces in filepath HOT 1
- fmerge error HOT 4
- error with join HOT 3
- join: error when using labels and key has different name in using
- fmerge overwrites master dataset's xtset HOT 2
- fmerge: 1:1 merge, error 3498, <id1 id2> do not uniquely identify obs. in the master data HOT 5
- Running ftools commands such as `join` can clear mata objects unrelated to ftools HOT 1
- Dict size exceeds Mata limits? HOT 5
- fmerge / join changes using-keys>100 to missing HOT 1
- Treat negative values in verbose(#) as if they were zero instead of positive HOT 1
- join does not clear sortedby macro HOT 6
- Support many to many join HOT 1
- fcollapse issue with double identifier HOT 2
- parallel_map crashes on computers with slow temp folder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ftools.