<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Laurie,<br>
<br>
Thanks for your question, and sorry for the delay getting back to
you, I was traveling. Below are some answers to your questions. If
you have any other questions or problems please let me know.<br>
<br>
Best,<br>
<br>
Andy<br>
<br>
<br>
<div class="moz-cite-prefix">On 4/13/2014 7:00 AM, Laurie Baker
wrote:<br>
</div>
<blockquote cite="mid:3726F24B-73CA-48A7-B4CF-28EB03AD5A9F@dal.ca"
type="cite">
<pre wrap="">Hello List,
I am using T-LoCoH to study the area surveyed by grey seals carrying acoustic tags and am interested in looking at this effort in space and time. I am looking at individual effort and also the area covered by multiple seals at the same time.
My questions are two-fold:
1. How to extract the total area and hull area for these tracks?</pre>
</blockquote>
<br>
I presume by 'tracks' you mean the locations for different
individuals. To begin with remember that T-LoCoH generates two types
of geometric objects - little hulls around each and every point, and
isopleths which are constructed by unioning the little hulls
together. By convention, the 95% isopleth is commonly labeled the
'home range', and the 50% isopleth is labeled the 'core'.<br>
<br>
Hulls and isopleths are both saved in a Locoh-hullset object as
SpatialPolygonDataFrames (a common R data class for polygons
objects). The hulls are saved in the $hulls element of a
Locoh-hullset, and the isopleths are saved in the $isos element. A
full description of these data classes was added to the tlocoh R
package as a vignette (pdf) in version 1.15.<br>
<br>
You can dig down in the data structure to get the areas, or you can
use the <tt>hulls()</tt> function to 'extract' just the hulls from
a Locoh-hullset object. More specifically, <tt>hulls()</tt> will
return a list of SpatialPolygonDataFrame objects, with one element
for each set of hulls in the Locoh-hullset object. There is a column
in the SPDF attribute table for hull area (as well as all the other
hull metrics). You can get the attribute table of a
SpatialPolygonsDataFrame object by referencing the <tt>data</tt>
slot with the @ character. <br>
<br>
<tt>> x <- hulls(lhs_ag214)</tt><tt><br>
</tt><tt>> class(x)</tt><tt><br>
</tt><tt>[1] "list"</tt><tt><br>
</tt><tt>> head(x[[1]]@data)</tt><tt><br>
</tt><tt> ptid pts.idx nnn area perim tspan nep
scg.enc.mean scg.enc.sd scg.nn.mean scg.nn.sd nsv.86400 mnlv.86400</tt><tt><br>
</tt><tt>1 65072 1 4 63247.5 2959.663 6 154
0.07744 0.07843 0.11870 0.07976 45 3.422222</tt><tt><br>
</tt><tt>2 65073 2 6 118709.0 3395.027 34 992
0.04382 0.05369 0.08671 0.07203 30 33.066667</tt><tt><br>
</tt><tt>3 65074 3 6 118709.0 3395.027 34 992
0.04382 0.05369 0.08671 0.07203 30 33.066667</tt><tt><br>
</tt><tt>4 65075 4 7 101100.5 1908.537 30 1868
0.03930 0.05101 0.06450 0.07096 33 56.606061</tt><tt><br>
</tt><tt>5 65076 5 8 116363.0 1732.254 20 376
0.04819 0.07690 0.06205 0.05860 44 8.545455</tt><tt><br>
</tt><tt>6 65077 6 9 146726.5 1914.184 18 204
0.06352 0.09957 0.05694 0.05586 31 6.580645</tt><tt><br>
</tt><br>
<br>
The attribute table for the isopleths SpatialPolygonstDataFrame also
stores isopleth area (in map units). The <tt>isopleths()</tt>
function operates similarly to the <tt>hulls() </tt>function - it
returns a list of SpatialPolygonDataFrames, with one element for
each set of isopleths.<br>
<tt><br>
</tt><tt>> x <- isopleths(lhs_ag214)</tt><tt><br>
</tt><tt>> length(x)</tt><tt><br>
</tt><tt>[1] 1</tt><tt><br>
</tt><tt>> x[[1]]@data</tt><tt><br>
</tt><tt> iso.level area edge.len nep ptp hm.val
num.hulls</tt><tt><br>
</tt><tt>1 0.15 686474.0 3431.878 3448 0.3221828
3448 1</tt><tt><br>
</tt><tt>2 0.25 686474.0 3431.878 3448 0.3221828
3448 1</tt><tt><br>
</tt><tt>3 0.35 779772.5 3877.031 4053 0.3787143
2776 6</tt><tt><br>
</tt><tt>4 0.45 1209995.2 5700.026 4880 0.4559895
2438 22</tt><tt><br>
</tt><tt>5 0.55 1774914.3 8034.811 5908 0.5520463
1123 1634</tt><tt><br>
</tt><tt>6 0.65 3478783.5 11015.241 6957 0.6500654
501 3248</tt><tt><br>
</tt><tt>7 0.75 5766729.3 15549.578 8067 0.7537843
285 4353</tt><tt><br>
</tt><tt>8 0.85 9178557.4 27815.017 9160 0.8559148
92 6750</tt><tt><br>
</tt><tt>9 0.95 18612464.6 49049.453 10167 0.9500093
26 9360</tt><tt><br>
</tt><tt>> </tt><br>
<br>
You can also view the area of each isopleth in R by using the <tt>iso.details=T</tt>
argument in the <tt>summary</tt> function: <br>
<br>
<tt>> summary(lhs_ag214, <b>iso.details=T</b>)</tt><tt><br>
</tt><tt>Loading required package: sp</tt><tt><br>
</tt><tt>Summary of LoCoH-hullset object: lhs_ag214 </tt><tt><br>
</tt><tt>T-LoCoH version: 1.0.3</tt><tt><br>
</tt><tt>[1] ag214.pts10702.a3700.s0.01.kmin0</tt><tt><br>
</tt><tt> id: ag214</tt><tt><br>
</tt><tt> pts: 10702</tt><tt><br>
</tt><tt> dates: 2009-09-02 13:00:00 GMT to 2010-04-14 13:00:00
GMT</tt><tt><br>
</tt><tt>movement: tau=1800 (30min), vmax=1.160352, d.bar=57.34979</tt><tt><br>
</tt><tt> hulls: 10702</tt><tt><br>
</tt><tt> dups: 205 (offset by 1 map unit)</tt><tt><br>
</tt><tt> mode: a=3700, kmin=0, s=0.01</tt><tt><br>
</tt><tt> metrics: area, mnlv.86400, nep, nnn, nsv.86400, perim,
scg.enc.mean, scg.enc.sd, scg.nn.mean,</tt><tt><br>
</tt><tt> scg.nn.sd, tspan</tt><tt><br>
</tt><tt> hmap: ivg (86400)</tt><tt><br>
</tt><tt> isos: [1] iso.srt-nep.iso-q.h10702.i9</tt><tt><br>
</tt><tt> <b>iso.level area edge.len
nep ptp hm.val num.hulls</b></tt><b><tt><br>
</tt></b><b><tt> 0.15 686474.0 3431.878 3448
0.3221828 3448 1</tt></b><b><tt><br>
</tt></b><b><tt> 0.25 686474.0 3431.878 3448
0.3221828 3448 1</tt></b><b><tt><br>
</tt></b><b><tt> 0.35 779772.5 3877.031 4053
0.3787143 2776 6</tt></b><b><tt><br>
</tt></b><b><tt> 0.45 1209995.2 5700.026 4880
0.4559895 2438 22</tt></b><b><tt><br>
</tt></b><b><tt> 0.55 1774914.3 8034.811 5908
0.5520463 1123 1634</tt></b><b><tt><br>
</tt></b><b><tt> 0.65 3478783.5 11015.241 6957
0.6500654 501 3248</tt></b><b><tt><br>
</tt></b><b><tt> 0.75 5766729.3 15549.578 8067
0.7537843 285 4353</tt></b><b><tt><br>
</tt></b><b><tt> 0.85 9178557.4 27815.017 9160
0.8559148 92 6750</tt></b><b><tt><br>
</tt></b><b><tt> 0.95 18612464.6 49049.453 10167
0.9500093 26 9360</tt></b><tt><br>
</tt><tt> other: -none-</tt><tt><br>
</tt><br>
<br>
<br>
<blockquote cite="mid:3726F24B-73CA-48A7-B4CF-28EB03AD5A9F@dal.ca"
type="cite">
<pre wrap="">2. How you might be able to illustrate and quantify the area overlapped by individual seals in space, and in time (i.e. area covered by seals at the same time) using this tool?
</pre>
</blockquote>
<br>
One way you can do this would involve:<br>
<br>
1) Decide which isopleth you want to use to represent the area of
used by an individual. As noted earlier, the 95% and 50% are common
standards, but there are others.<br>
<br>
2) Pull out those isopleths for each individual<br>
<br>
3) Take the intersection of pairs of isopleths using a function from
the rgeos package, and compute the area.<br>
<br>
There are other more nuanced ways to measure the overlap in space
use in two individuals, but the above process should get you
started. A script that illustrates how do to the above can be found
at:<br>
<br>
<a
href="http://nature.berkeley.edu/%7Eajlyons/tlocoh/isopleth_overlap_exericse.txt">http://nature.berkeley.edu/~ajlyons/tlocoh/isopleth_overlap_exericse.txt<br>
</a>or<br>
<a
href="http://tlocoh.r-forge.r-project.org/isopleth_overlap_exericse.R">http://tlocoh.r-forge.r-project.org/isopleth_overlap_exericse.txt</a><br>
<br>
If you want to quantify the area of overlap between seals at the
exact same time, or for example within the same 24 hour period, we
should talk some more about that. There are some association hull
metrics that are still under development that do something similar
to that. <br>
<br>
<blockquote cite="mid:3726F24B-73CA-48A7-B4CF-28EB03AD5A9F@dal.ca"
type="cite">
<pre wrap="">Question 1:
I think I have identified where I can find this information from the object generated in the toni example, toni.lhs.k15:
names(toni.lhs.k15[[1]])
#[1] "id" "pts" "anv" "rw.params" "mode" "k" "r"
#[8] "a" "auto.a" "s" "kmin" "dups" "desc" "hulls"
#[15] "hm" "enc.pts" "hm.params" "gen.date" "isos"
Is the information stored in "hulls" or "isos"? Is there a way to extract this information one hull at a time? The command toni.lhs.k15[[1]]$hulls floods the console and I am not able to view it in its entirety.
Question 2:
I tried analyzing all tracks and not including seal id to distinguish different tracks, but this is a problem given that certain time stamps are the same. Is there a way to overlay the area covered by individuals and match this to time?</pre>
</blockquote>
<br>
I don't fully understand this question. Could you provide some more
detail?<br>
<br>
<blockquote cite="mid:3726F24B-73CA-48A7-B4CF-28EB03AD5A9F@dal.ca"
type="cite">
<pre wrap="">
Cheers,
Laurie
_______________________________________________
Tlocoh-info mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Tlocoh-info@lists.r-forge.r-project.org">Tlocoh-info@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info">http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info</a>
</pre>
</blockquote>
<br>
</body>
</html>