Habitat Mask Polygon

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

Habitat Mask Polygon

Postby Lombardijv » Tue Apr 01, 2014 2:26 pm

Murray,

I wanted to add a shapefile of my study area (which also included all non-habitat (e.g., roads, bodies of water) to create a new habitat mask. I successfully loaded my shapefile as a polygon into R using readShapeFile, but when I wrote the make.mask code I received an error and I do not know how to proceed. I wanted to know if you can recommend how I should correct this.

Code: Select all
 NacPoly <- readShapePoly("nac_boundry.shp")

 nacmask <- make.mask(traps(BCVCH), type = "trapbuffer", buffer = 1000, spacing = 641.533, nx=64, poly = "NacPoly", poly.habitat=TRUE, keep.poly = TRUE)

Error in FUN(newX[, i], ...) :
  NA/NaN/Inf in foreign function call (arg 5)
In addition: Warning message:
In FUN(newX[, i], ...) : NAs introduced by coercion




Thank You,

Jason
Lombardijv
 
Posts: 9
Joined: Mon Mar 17, 2014 1:07 pm

Re: Habitat Mask Polygon

Postby murray.efford » Tue Apr 01, 2014 3:03 pm

I can't see a problem in your code; maybe there's something odd in your data. If you can't find the problem then send me the files and I'll post what I find.
Murray
murray.efford
 
Posts: 712
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: Habitat Mask Polygon

Postby murray.efford » Thu Apr 03, 2014 5:25 pm

Do not put the poly name in quotes. I should have spotted this error right off. Also, do not specify both spacing and nx: one will do.
Murray
murray.efford
 
Posts: 712
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand


Return to analysis help

Who is online

Users browsing this forum: No registered users and 0 guests

cron