multi-session oSCR - error: cannot allocate vector of size 52.1 gb

93 views
Skip to first unread message

Lauren Moore

unread,
Nov 15, 2021, 2:13:00 PM11/15/21
to oSCR

Hi all!

I would love some help with an issue I’m having with my multi-session oSCR with sex and habitat co-variates, please! The issue comes when trying to create ssDF as the error states ‘error: cannot allocate vector of size 52.1 gb’. My confusion comes from two things: 1) my dataset is relatively small and the chances of a vector being 52.1gb seem slim! 2) I ran the exact code with another dataset and it ran perfectly, a dataset that is similar, if not larger, in size.

I’ve tried reading (and re-reading) several papers, manuals and help forums, but no luck yet. I’ve tried all of the usual solutions for similar problems, such as gc(), memory.limit, memory.limit(size=), and clearly apps, etc from the computer, but none have worked. I've tried it on several different computers/laptops etc, using external hardrives with TBs of memory too, but the same error appears. I don't get this issue when running a single session oSCR, however would love to run a multi-session oSCR as it better suits my data.

The data set: 3 sessions, with 10 occasions in each, all with 126 traps. I have attached the data and the relevant code is below.

What could be causing this issue (what seems to be a mismatch between dataset size and apparent size of vector being made by ssDF) and is there a solution? I’d be really grateful for any thoughts.

Thank you very much!


Code:

hog_edf <- read.csv("Frn.sessions.edf.csv")

hog.tdf <- read.csv("Frn.hab.tdf.csv",header = TRUE)


## Step 2: Format data, make scrFrame and state space ----

hog.data <- 

  data2oscr(edf = hog_edf,

            tdf = list(hog.tdf,hog.tdf,hog.tdf), 

            sess.col = which(colnames(hog_edf)%in%"SESSION"), 

            id.col = which(colnames(hog_edf)%in%"ANIMAL_ID"),

            occ.col = which(colnames(hog_edf)%in%"SO"), 

            trap.col = which(colnames(hog_edf)%in%"TRAP_ID"),

            sex.col = which(colnames(hog_edf)%in%"SEX"),

            sex.nacode = "NA",

            K = c(10,10,10), #number of occasions per session

            ntraps = rep(126,3), #number of traps per session

            trapcov.names = c("hab"),

            tdf.sep = "/")


# make scrFrame

hog.sf <- hog.data$scrFrame


# get summary

hog.sf


#plot a summary

par(mfrow=c(3,3),mar=c(1,1,1,1),oma=c(0,0,0,0))

plot(hog.sf, ax = F) #plot a summary


#### Make state space and buffer using make.ssDF ####

# buffer should be ~3x sigma. 

hog.sf$mmdm

# buffer should be between 600-800m

# pixel resolution = 100m x 100m = 0.01km2, buffer 600m

ssDF <- make.ssDF(hog.sf,res=0.1, buff=0.6)  #THIS IS WHERE THE ERROR APPEARS

par(mfrow=c(3,3),mar=c(1,1,1,1),oma=c(0,0,0,0))

plot(ssDF, hog.sf, spider=TRUE) 

Frn.sessions.edf.csv
Frn.hab.tdf.csv

Lauren

unread,
Nov 15, 2021, 2:16:25 PM11/15/21
to oSCR
csv files attached.
Frn.sessions.edf.csv
Frn.hab.tdf.csv

Jeffrey Royle

unread,
Nov 15, 2021, 2:37:23 PM11/15/21
to oSCR
hi Lauren, your coordinate system seems to be in meters and when you create the ssDF you're using a resolution of one-tenth of a meter. That's a lot of state-space points!
I would change that to something like this:

ssDF <- make.ssDF(hog.sf,res=1000, buff=6000)   

regards
andy












--
You received this message because you are subscribed to the Google Groups "oSCR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oscr_package...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/05e56bea-9303-41d5-aa57-acfa29bcdb7cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages