Re: [R] Sorting in trees problem

2016-02-24 Thread Bert Gunter
"%in%" is a wrapper for match(), which uses hashing I believe (correction welcome!),and so is generally very fast. See ?Rprof for profiling R code to get timings. (Haven't used it myself, so not sure how useful it would be for this situation). -- Bert Bert Gunter "The trouble with having an o

[R] Sorting in trees problem

2016-02-24 Thread Axel Urbiz
Hello, As decision trees require sorting the variable used for splitting a given node, I'm trying to avoid having this recurrent sorting by only sorting all numeric variable first (and only once). My attempt in doing this is shown in "Solution 2" below, but although I get the desired result I thi