Error in grid.union(x) : Inconsistent grid resolutions.

50 views
Skip to first unread message

Kerry Kilshaw

unread,
Dec 12, 2025, 11:43:22 AM12/12/25
to ctmm R user group
Hi everyone

I'm having issues over the past couple of days in carrying out mean.UD even though the script I've been using has previously been successful (with a slightly different dataset). I keep getting this error; 

"Error in grid.union(x) : Inconsistent grid resolutions"

# I have made sure I am doing this before running the models;

ctmm::projection(Segmented_2025.telemetry) <- median(Segmented_2025.telemetry)


#The models all seem to run fine and if I then estimate the AKDEs as a list that all seems to work fine and the UD.s plot out fine, and summary values etc all look good. 

#Then I try use the following script to extract models for an individual that was segmented seasonally; 

# Create EXT for Mean Calculation

Mean_EXT_2025<- extent (hrange_list_2025, level = 0.95) # all individuals

 

# Extract UD's for ASP23

ASP23_HR <- hrange_list_2025 [c("ASP23_1", "ASP23_2")] # extract segmented individuals from AKDE list


# plot uds

plot_ud(ASP23_HR) # see attached document



# The projection for both objects in the list appears to be the same for telemetry and models:

all(sapply(ASP23.telemetry, function(x) ctmm::projection(x)) ==
    sapply(ASP23_models, function(x) ctmm::projection(x)))

TRUE



# Get mean weighted by days of data

Mean_ASP23 <-mean(ASP23_HR, weights=c(74,50), sample=FALSE, EXT= Mean_EXT_2025)

 

Error in grid.union(x) : Inconsistent grid resolutions.


I can't really figure out whats going on here....  I have attached my full script FYI which uses some of the functions from ctmmweb. I am running ctmm version 1.3, R version 4.5.1 in case that makes any difference? Any suggestions welcome?!


Thanks so much, 

Kerry

ASP23_HR .docx

Christen Fleming

unread,
Dec 25, 2025, 4:50:09 PM12/25/25
to ctmm R user group
Hi Kerry,

The individual calls to akde() without a grid argument are causing the outputs to have different resolutions. Unless the homeranges are of wildly different sizes, you can just make one call to akde() on a list of all individuals to get a consistent grid for further calculations that use the them.

Best,
Chris

K. Kilshaw

unread,
Feb 5, 2026, 3:59:36 PMFeb 5
to ctmm R user group
Ah thanks so much Chris, that makes more sense! Apologies for the delayed reply, got sidetracked by some other analysis.

Many thanks for getting back to me, much appreciated.

Best

Kerry

Zachary Aronson-Paxton

unread,
Feb 13, 2026, 5:29:44 PM (12 days ago) Feb 13
to ctmm R user group
Hi everyone!

I am having a similar problem with my grids, except while using the pkde function. I currently have two pkdes for two different animal species and I am trying to run a CDE function on my pkdes. However, I am encountering errors with my grid resolutions because my pkdes have inconsistent grids. When checking these grids they come back as "null", but I am able to find the extent and dr in the pkde object and can verify that they are different.  

While I was able to run my akdes that I used to create my pkdes with one akde() call, I am struggling to see how that can be possible with two pkdes of separate species. I tried to rerun one pkde with the grid of the other by using pkde2 <- pkde ( .... grid = pkde1), however when I rechecked the grid it was "null" and the extent was the same as before. 

Do you have any suggestions on how to match the grids from different pkde home ranges to be able to run a CDE on them? 

Any suggestions are welcome! Thank you so much,
Zachary 

Reply all
Reply to author
Forward
0 new messages