[tlocoh-info] Ancillary variables

Andy Lyons lyons.andy at gmail.com
Tue Oct 25 18:16:58 CEST 2016


Hi Maja,

I don't see anything obviously wrong with your code. The fact that 
you're getting an error message suggests you might have encountered a 
bug or there is something about your data the function isn't dealing 
with properly. I can help you sort through the errors if I can reproduce 
them. Can you send me a separate email and we'll figure out a way to 
figure this out? For example we can do a video call or you could send me 
a chunk of your code and data that reproduces the error. Then we can 
report back to the list how the issue was solved.

Cheers,
Andy


On 10/25/2016 5:50 AM, maja.bradaric92 at gmail.com wrote:
>
> Hi Andy (and everyone),
>
> Thank you very much for your reply. During past few days I’ve managed 
> to find all of these functions myself and to check how they work on my 
> data.
>
> However, I encountered some problems. When I used ancillary variable 
> as hull metric in order to make a two dimensional scatter plot and run 
> this function:
>
> hsp2 <- lhs.plot.scatter(Lizard.lhs.k21, x="anv", y="area", 
> anv="Air_temp",col="spiral",bg="black"),
>
> I was sent to the debugging environment in R. The message on the top 
> says: “Debug location is approximate because the source is not 
> available”, and when I do the execution, I get my scatter plot. But, 
> when I run the next function:
>
> plot(Lizard.lhs.k21, hpp=T,hsp=hsp2, hpp.classify="hsp"),
>
> so I can plot my data points and use a scatter plot as a legend, I get 
> the following error message: ”Can’t find values for saved hull scatter 
> plot”. I am guessing I should do something differently in the debug 
> part of the problem?
>
> Also, I think it would be nicer to use mean values of ancillary 
> variables for all data points included in one hull, not only the value 
> of parent point, and I would be really grateful if you or anyone else 
> can help me with that.
>
> Cheers,
>
> Maja
>
> *From: *Andy Lyons <mailto:lyons.andy at gmail.com>
> *Sent: *24 October 2016 19:22
> *To: *maja.bradaric92 at gmail.com <mailto:maja.bradaric92 at gmail.com>; 
> tlocoh-info at lists.r-forge.r-project.org 
> <mailto:tlocoh-info at lists.r-forge.r-project.org>
> *Subject: *Re: [tlocoh-info] Ancillary variables
>
> Hi Maja. Good questions. You are correct that there are not many 
> guidelines for using ancillary variables in the documentation, but 
> your instincts on how they could be useful in an analysis seem spot 
> on. As a reminder to others, 'ancillary variable' is the T-LoCoH term 
> for additional columns or attributes associated with each location. 
> They can be either measured values from a GPS sensor (e.g., 
> temperature), or derived during post-processing from other data (e.g., 
> NDVI values). See lxy.anv.add() and lxy.gridanv.add(). Internally, 
> ancillary variables are saved in columns in the data frame attached to 
> the SpatialPointsDataFrame which contains the locations. All the 
> original points are saved in both locoh-xy and locoh-hullset objects.
>
> One way you can use ancillary variables is for subsetting data, as you 
> suggested. This could be useful for example if you wanted to look at 
> space use patterns for different sets of locations based on an 
> attribute field. To create subsets of hulls, see lhs.filter.anv(), to 
> create subsets of points from a locoh-xy object see lxy.subset() (I 
> can send a code sample if it isn't clear how to use). Subsetting 
> location data could also of course be done prior to turning the 
> locations into a locoh-xy object.
>
> Ancillary variables can also be used to sort hulls when constructing 
> isopleths. This is one option for differentiating internal space 
> within the 'home range' along a gradient other than density. If your 
> GPS sensor recorded temperature, for example, you could create a 
> utilization distribution that highlights how the individual used the 
> space based on a temperature gradient. IMHO, the ability to create UDs 
> that differentiate space use along behavioral or environmental 
> gradients is one of T-LoCoH's most interesting and underutilized 
> features which has a lot of promise for connecting the concept of a 
> home range to a much broader range of behavioral and ecological 
> questions (e.g., Fieberg and Börger 2012 
> <http://jmammal.oxfordjournals.org/content/93/4/890>).
>
> To sort hulls based on an ancillary variable, you would pass 
> sort.metric="anv" to the function lhs.iso.add(), with an additional 
> argument called anv that passes the name of the ancillary variable 
> column name of interest (e.g., anv="temp"). The 'anv' hull metric is 
> defined to be the ancillary variable value of the hull parent point. 
> You may ask why the hull parent point, and not the mean value of all 
> points used to construct the hull, or all points enclosed by the hull? 
> That was just the easiest to implement, but if you were going to sort 
> hulls for isopleths it might be better to define a hull metric for the 
> mean ancillary value for all enclosed points (depends on the pattern 
> you're seeking). Defining new hull metrics is not terribly hard but 
> takes some coding knowledge, contact me for details.
>
> You can also use ancillary variables of the hull parent point as you 
> would any other hull metric - for plotting symbology, in scatter 
> plots, etc. If you see an interesting pattern in a two-dimensional 
> scatterplot of an ancillary variable and another hull metric, you can 
> use that as a legend in a map (e.g., Fig 10 
> <https://static-content.springer.com/image/art%3A10.1186%2F2051-3933-1-2/MediaObjects/40462_2012_Article_2_Fig10_HTML.jpg> 
> in Lyons et al 2013 <http://dx.doi.org/10.1186/2051-3933-1-2>).
>
> Hope this helps you think about possible ways for using ancillary 
> variables in an analysis. A lot of this is new territory, but T-LoCoH 
> is all about giving you a flexible set of tools to explore and 
> visualize your data. Let me know if you have any questions or need 
> help with any of the functions.
>
> Cheers,
> Andy
>
>
> On 10/19/2016 6:54 AM, maja.bradaric92 at gmail.com 
> <mailto:maja.bradaric92 at gmail.com> wrote:
>
>     Hello everyone,
>
>     I’ve started to use T-LoCoH just recently and I am still
>     investigating can this package help me answer all the questions I
>     have in my research. I guess this is very basic question, but,
>     there is no so much explained about ancillary variables and what
>     can be done if we have them in our data.
>
>     If I include ancillary variables in my lxy object (temperature,
>     for example), does that mean space use maps will later be created
>     according to the ancillary variable? Or I can use them just to
>     make subsets of the hulls according to certain temperature values?
>     Can I produce behavioural maps according to temperature and
>     possible temperature changes? I don`t really understand how this
>     works, so I would be very grateful for any clarification, in order
>     to be able to continue with my data analysis.
>
>     Also, is it possible to include only one ancillary variable, or it
>     can be more of them?
>
>     Thanks in advance.
>
>     Cheers,
>
>     Maja
>
>
>
>
>     _______________________________________________
>
>     Tlocoh-info mailing list
>
>     Tlocoh-info at lists.r-forge.r-project.org
>     <mailto:Tlocoh-info at lists.r-forge.r-project.org>
>
>     http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info
>
> -- 
> *T-LoCoH*: A hull-based method for home range construction and 
> spatiotemporal analysis of movement data.
> Lyons, A., Turner, W.C., and WM Getz. 2013. Home Range Plus: A 
> Space-Time Characterization of Movement Over Real Landscapes. BMC 
> Movement Ecology 1:2 
> <http://www.movementecologyjournal.com/content/1/1/2>.
> http://tlocoh.r-forge.r-project.org
>
>
>
> _______________________________________________
> Tlocoh-info mailing list
> Tlocoh-info at lists.r-forge.r-project.org
> http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/tlocoh-info

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/tlocoh-info/attachments/20161025/c8e484b2/attachment-0001.html>


More information about the Tlocoh-info mailing list