TrigosTeam / SPIAT

https://trigosteam.github.io/SPIAT/
Artistic License 2.0
21 stars 8 forks source link

calculate_spatial_autocorrelaton is not working #11

Closed yuvibim08 closed 1 year ago

yuvibim08 commented 2 years ago

please see the error

after forming a grid image, we wanted to find out the spatial autocorrelation, but it gave the following error.

script: N_grid <- grid_metrics(N_form_image, FUN = calculate_entropy, n_split = 20, cell_types_of_interest=c("Tumour","TAMS"), feature_colname = "Cell.Type")

calculate_percentage_of_grids(N_grid, threshold = 0.50, above = TRUE) calculate_spatial_autocorrelation(N_grid, metric = "globalmoran")

error: Error in w[,1] : incorrect number of dimensions error_autocorrelation

fuerzhou commented 2 years ago

Hi @yuvibim08,

Thank you for raising the issue. For this error, may I ask for the grid plot generated by the grid_metrics() function? Please email yuzhou0610@gmail.com if you would like to privately send the image. Thanks!

yuvibim08 commented 2 years ago

Thank you for your reply, I will contact you through the mail.

yuvibim08 commented 2 years ago

Thank you for your previous assistance, I am still getting the same error for this function, could you please look into it? Also, let me know if I am doing anything wrong.

fuerzhou commented 1 year ago

Sorry for the very late update. The error was due to a hard coded distance in the function. It is updated now with an additional argument d in version 1.2.3. When d is NULL, the distance will be automatically calculated. Closing the issue now.