Skip to content

Converting spatialPointsDataFrame into ppp

5 messages · Roger Bivand, Aurelie Cosandey Godin

#
Dear all,

I am new to spatial and point process analysis (as well as R), however most
of my Ph.D. will rely heavily on these tools *sighs :) I am starting a new
chapter where I intend to model elasmobranch i.e., shark and skate catch in
the Northwest Atlantic Canadian waters using point process modeling. I am
interested in investigating the spatial, temporal, and space?time clustering
of catch events conditioned upon the distribution of fishing locations. 

I have been following the R-sig-geo mails and found many great reading
suggestions, which were very helpful! Thank you. I would like to do some
exploratory data analysis on a small subset of my database i.e., solely
shark catch for the year 2009 (546 observations), but I am running (not
surprisingly) into errors and warnings!

Would be grateful to anyone's help!
I am trying to convert my SpatialPointsDataFrame into a ppp. Right now, I
would just like to make a ppp with "catch" as a mark (this is the catch size
in kg).
[1] "SpatialPointsDataFrame"
attr(,"package")
[1] "sp"

#SHK09 looks as follow
year month day tripID setID gear NAFO     x      y kept discard fmonth
fgear
1 2009     8  17    345    16    5   22 55.41 -58.46    0     227    Aug   
GN
2 2009     2   1      3     2    1   23 52.36 -51.24    0     450    Feb   
OT
3 2009     7  28    296     4    5    9 68.37 -59.34    0     250    Jul   
GN
4 2009     9   5    339    29    5    9 68.27 -59.53    0      10    Sep   
GN
5 2009     8  28    316    44    5    9 68.38 -64.36    0    1400    Aug   
GN
6 2009     9   1    316    49    5    9 69.26 -64.50    0     200    Sep   
GN
      fNAFO        t.spp.name t.spp.category         elasmo.name
elasmo.category
1        2H GREENLAND HALIBUT              0 SHARKS,DOGFISH (NS)              
1
2        2J GREENLAND HALIBUT              0     SHARK,GREENLAND              
1
3 BaffinIsd GREENLAND HALIBUT              0     SHARK,GREENLAND              
1
4 BaffinIsd GREENLAND HALIBUT              0     SHARK,GREENLAND              
1
5 BaffinIsd GREENLAND HALIBUT              0     SHARK,GREENLAND              
1
6 BaffinIsd GREENLAND HALIBUT              0     SHARK,GREENLAND              
1
  catch logcatch
1   227 5.429346
2   450 6.111467
3   250 5.525453
4    10 2.397895
5  1400 7.244942
6   200 5.303305

#I tried to do the following as suggested by prior email, however, I get
this following error message
Error in `coordinates<-`(`*tmp*`, value = ~x + y) : 
  setting coordinates cannot be done on Spatial objects, where they have
already been set

#so decided to proceed as follow
Error in as(SHK09["catch"], "ppp") : 
  no method or default for coercing "SpatialPointsDataFrame" to "ppp"

Ideas?
Thank you very much in advance!

~~Aurelie

Aurelie Cosandey-Godin
Ph.D. Candidate, Department of Biology, Dalhousie University
Industrial Graduate Fellow, WWF-Canada
Email: godina at dal.ca | Web: wormlab.biology.dal.ca
-----------------------------------------------------------------------------------------------------
Want to learn more about sharks in Atlantic Canada? Visit ShARCC!
www.atlanticsharks.org





--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Converting-spatialPointsDataFrame-into-ppp-tp2764866p6801137.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
#
On Fri, 16 Sep 2011, GodinA wrote:

            
Well, that is what you would expect.
Did you look at the vignette for the spatstat package about handling 
shapefiles? You would note that you need the maptools package, which also 
contains the as() coercion functions. They are there, rather than in sp or 
spatstat, to try to avoid unwanted dependencies between packages.

However, I doubt whether your data are a marked point process - the catch 
positions were decided by someone, not, say, the fish? Have you thought of 
trying the bubble() function in sp?

Roger

  
    
1 day later
#
Thank you very much for this quick reply Dr. Bivand.
I am taking good notes of your suggestions.

I'm a little concern about your comments that my data are not a marked point
process and would like to verify with you a few points. You are correct that
my points - the catch positions are essentially fishermen decisions.
However, I am using at-sea observer data, which are (technically) random
sampling of a subset of all fishing effort (usually between 5-15
percent/year, although it varies between years, fisheries, and regions). As
a starting point, I would like to reproduce what Gardner et al. (2008) have
done. [Gardner B, Sullivan PJ, Morreale SJ, Epperly SP. Spatial and temporal
statistical analysis of bycatch data: patterns of sea turtle bycatch in the
North Atlantic. Canadian Journal of Fisheries and Aquatic Sciences.
2008;65(11):2461-2470. Available from:
http://www.nrcresearchpress.com/doi/abs/10.1139/F08-152]. 
However, my data are somewhat more complex since I am dealing with different
fishing gears (over 15 types) over the spend of 15 years (1995-2010). I
would like to go beyond describing the space-time clustering of catch events
and try to model these events to oceanographical variables, such as
temperature and ocean-color derived chlorophyll concentration.

I would be grateful for any of your thoughts, comments, and/or suggestions. 
Thank you very much for your time,

Best,
~~Aurelie




-----
Aurelie Cosandey-Godin
Ph.D. Candidate, Department of Biology
Industrial Graduate Fellow, WWF-Canada

Dalhousie University | Biology Dept. |Halifax, NS, Canada 
Email: godina at dal.ca | Web: wormlab.biology.dal.ca
--------------------------------------------------------------------------
Want to learn more about sharks in Atlantic Canada? Visit ShARCC! www.atlanticsharks.org
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Converting-spatialPointsDataFrame-into-ppp-tp2764866p6804881.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
#
On Sat, 17 Sep 2011, GodinA wrote:

            
Are you studying the spatial decisions of the fishermen, that is, is it 
the clustering of catch data in space that is your main concern? You say 
that you have a sample - in general point patterns should be complete, not 
samples, because the sampling process could obscure the underlying spatial 
process.
Only for subscribing institutions, I think. The fact that something has 
been published doesn't necessarily make it sensible (I don't have access 
to this case, speaking generally; from the abstract they seem to be 
looking at bycatch spatial patterns using point pattern analysis, the 
abstract doesn't say if they had access to all bycatch data).
This implies inhomogeneity in the spatial process induced by the 
space-time-varying covariates, so is rather ambitious in a point process 
setting. It feels much more like a GLMM or GAMM, not least because the 
paper you cite deals with bycatch (so clustering is arguably not caused by 
the decisions of the fishermen), and you are dealing with catch, which is 
caused by the decisions, and you only have a sample.

I'm not a fisheries person, it just struck me that it didn't seem obvious 
that a marked point process was a helpful representation of your problem. 
I'm sure others on this list have comments and ideas.

Hope this helps,

Roger

  
    
#
My mistake, I avoided using the word 'bycatch' to not get into the
definition, but I am actually looking at bycatch events, in other words,
where the presence or absence of nontarget species i.e., shark/skate in the
catch is recorded as a single point for a specific fishing location.
Following Gardner et al. (2008), I would like to test the null hypothesis
that marks (shark/skate captures) are distributed randomly within the non-
random spatial distribution of events (fishing locations). They used a
permutation test, whereby under a series of simulations, the marks were
randomly assigned to event locations (i.e., permuted) to create a series of
distributions that represent complete spatial randomness conditioned upon
the location of the fishing events. I just verified if Gardner et al. (2008)
had all points or 100 percent at-sea observer data, but they didn't (between
3-5%), with the exception of 2 years (100%). In a sense this is their
complete set of point process. However what will be described/model will
undeniably be only what has been observed and potentially far from
describing overall clusters of bycatch events within fishing locations.

Anyone who worked or have experience with fishery data on this mail list is
welcome to join the discussion. 

I am looking for advices on how I (or if I should pursue the idea) can model
bycatch data with point process. Essentially, I know that fishing locations
are not randomly located in space, but I would like to take a similar
approach then Gardner et al. (2008) and compare the known bycatch capture
locations with a simulated set of bycatch captures, which are randomly
located within the known fishing locations. I am using at-sea observer data
(best data available), which often is only 5-15% of all fishing locations,
but this varies over the years, fishery, and regions. I have 15 years of
data (1995-2010).
It doesn't seem that obvious that I can model bycatch event with point
process. I would love to hear people experience, comments, advices, and/or
ideas.

Thank you very much for your time,
Cheers,
~~Aurelie

Gardner B, Sullivan PJ, Morreale SJ, Epperly SP. Spatial and temporal
statistical analysis of bycatch data: patterns of sea turtle bycatch in the
North Atlantic. Canadian Journal of Fisheries and Aquatic Sciences
2008;65(11):2461-2470. Available from:
http://www.nrcresearchpress.com/doi/abs/10.1139/F08-152


-----
Aurelie Cosandey-Godin
Ph.D. Candidate, Department of Biology
Industrial Graduate Fellow, WWF-Canada

Dalhousie University | Biology Dept. |Halifax, NS, Canada 
Email: godina at dal.ca | Web: wormlab.biology.dal.ca
--------------------------------------------------------------------------
Want to learn more about sharks in Atlantic Canada? Visit ShARCC! www.atlanticsharks.org
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Converting-spatialPointsDataFrame-into-ppp-tp2764866p6805571.html
Sent from the R-sig-geo mailing list archive at Nabble.com.