acorg/Racmacs

checkHemisphering

Opened this issue · 0 comments

checkHemisphering doesn't work for 3D maps, is fine for 2D maps. Typo on line 72 as below.

library(Racmacs)
packageVersion("Racmacs")
[1] ‘1.1.38’

set.seed(123)
dat <- matrix(102^round(10runif(100)), ncol=10)
set.seed(456)
map <- make.acmap(dat, verbose=F, options=list(report_progress = F), number_of_dimensions = 3)

ch <- checkHemisphering(map)
R(56515,0x11b889e00) malloc: *** error for object 0x7f815c472f60: pointer being freed was not allocated
R(56515,0x11b889e00) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort R

src/ac_hemi_test.cpp
Line 72:
hemi_ag_improved_coords(3) = grid_results.zcoords( sub(2) );
should be
Line 72:
hemi_ag_improved_coords(2) = grid_results.zcoords( sub(2) );