Grokbase Groups R r-help June 2016
FAQ
Hi List,


I'm relatively new to R, so apologies if my question is rather elementary.
I'm working with some bird tracking data and I would like to calculate the maximum distance traveled from the colony.
For the maximum distance traveled, I was going to use the function homedist(). However, when I try to use this function I get the following error:
Error: could not find function "homedist"
Anyone know why I would get this error? I have been using other functions in "trip" without an issue. Is there an alternative way I can calculate this?


Thanks in advance for any help!


  [[alternative HTML version deleted]]

Search Discussions

  • Jim Lemon at Jun 15, 2016 at 8:18 am
    Hi Alice,
    Have you tried creating a vector of the start position (xpos[1],ypos[1]):


    xstart<-rep(xpos[1],n)
    ystart<-rep(ypos[1],n)
    # where "n" is the number of subsequent positions in the trip
    max(trackDistance(xstart,ystart,xpos[2:n],ypos[2:n],...))


    may then give you the value of the longest distance from the start. I
    don't have the trip package or I could see if you really need to
    replicate the start positions.


    JIm



    On Wed, Jun 15, 2016 at 1:43 PM, Alice Domalik wrote:
    Hi List,

    I'm relatively new to R, so apologies if my question is rather elementary.
    I'm working with some bird tracking data and I would like to calculate the maximum distance traveled from the colony.
    For the maximum distance traveled, I was going to use the function homedist(). However, when I try to use this function I get the following error:
    Error: could not find function "homedist"
    Anyone know why I would get this error? I have been using other functions in "trip" without an issue. Is there an alternative way I can calculate this?

    Thanks in advance for any help!

    [[alternative HTML version deleted]]

    ______________________________________________
    R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
    https://stat.ethz.ch/mailman/listinfo/r-help
    PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
    and provide commented, minimal, self-contained, reproducible code.
  • Rolf Turner at Jun 15, 2016 at 8:49 am

    On 15/06/16 20:18, Jim Lemon wrote:
    Hi Alice,
    Have you tried creating a vector of the start position (xpos[1],ypos[1]):

    xstart<-rep(xpos[1],n)
    ystart<-rep(ypos[1],n)
    # where "n" is the number of subsequent positions in the trip
    max(trackDistance(xstart,ystart,xpos[2:n],ypos[2:n],...))

    may then give you the value of the longest distance from the start. I
    don't have the trip package or I could see if you really need to
    replicate the start positions.

    Jim: This seems to me to be somewhat off the point. The OP was faced
    with the problem of not being able to access the function homedist().
    This function seems *not* to be exported from the trip package, and yet
    it is a *documented* function which I would assume to imply that users
    should be able to invoke it directly.


    It is possible that in the past the OP was dealing with a version of the
    trip package that was created before namespaces came into the picture,
    whence "exporting" was not relevant. I would suggest that the OP
    contact the package maintainer (maintainer("trip") will give you the
    email address) and enquire as to what is going on.


    In the interim, a workaround *might* be to invoke homedist() as


          trip:::homedist(<whatever>)


    Note the *triple* colon in the foregoing. I am not at all familiar with
    the trip package so my advice should probably be taken with several
    grains of salt.


    cheers,


    Rolf Turner


    --
    Technical Editor ANZJS
    Department of Statistics
    University of Auckland
    Phone: +64-9-373-7599 ext. 88276

    On Wed, Jun 15, 2016 at 1:43 PM, Alice Domalik wrote:
    Hi List,

    I'm relatively new to R, so apologies if my question is rather elementary.
    I'm working with some bird tracking data and I would like to calculate the maximum distance traveled from the colony.
    For the maximum distance traveled, I was going to use the function homedist(). However, when I try to use this function I get the following error:
    Error: could not find function "homedist"
    Anyone know why I would get this error? I have been using other functions in "trip" without an issue. Is there an alternative way I can calculate this?

    Thanks in advance for any help!
  • Michael Sumner at Jun 16, 2016 at 2:17 am

    On Wed, 15 Jun 2016 at 18:51 Rolf Turner wrote:

    On 15/06/16 20:18, Jim Lemon wrote:
    Hi Alice,
    Have you tried creating a vector of the start position (xpos[1],ypos[1]):

    xstart<-rep(xpos[1],n)
    ystart<-rep(ypos[1],n)
    # where "n" is the number of subsequent positions in the trip
    max(trackDistance(xstart,ystart,xpos[2:n],ypos[2:n],...))

    may then give you the value of the longest distance from the start. I
    don't have the trip package or I could see if you really need to
    replicate the start positions.
    Jim: This seems to me to be somewhat off the point. The OP was faced
    with the problem of not being able to access the function homedist().
    This function seems *not* to be exported from the trip package, and yet
    it is a *documented* function which I would assume to imply that users
    should be able to invoke it directly.

    It is possible that in the past the OP was dealing with a version of the
    trip package that was created before namespaces came into the picture,
    whence "exporting" was not relevant. I would suggest that the OP
    contact the package maintainer (maintainer("trip") will give you the
    email address) and enquire as to what is going on.
    This is correct, the maintainer of trip never finished the task and so it's
    documented but not exported - but also the CRAN version is incorrect so
    please don't use it. Apologies for this.



    In the interim, a workaround *might* be to invoke homedist() as

    trip:::homedist(<whatever>)

    Please don't do this, the current definition is incorrect. I've updated it
    here but can't spend much time checking, any direct input to me is welcome
    - perhaps via the Issues feature on the GitHub repository.


    https://github.com/mdsumner/trip


    Again, my apologies for this.


    Cheers, Mike.



    Note the *triple* colon in the foregoing. I am not at all familiar with
    the trip package so my advice should probably be taken with several
    grains of salt.

    cheers,

    Rolf Turner

    --
    Technical Editor ANZJS
    Department of Statistics
    University of Auckland
    Phone: +64-9-373-7599 ext. 88276
    On Wed, Jun 15, 2016 at 1:43 PM, Alice Domalik wrote:
    Hi List,

    I'm relatively new to R, so apologies if my question is rather
    elementary.
    I'm working with some bird tracking data and I would like to calculate
    the maximum distance traveled from the colony.
    For the maximum distance traveled, I was going to use the function
    homedist(). However, when I try to use this function I get the following
    error:
    Error: could not find function "homedist"
    Anyone know why I would get this error? I have been using other
    functions in "trip" without an issue. Is there an alternative way I can
    calculate this?
    Thanks in advance for any help!
    ______________________________________________
    R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
    https://stat.ethz.ch/mailman/listinfo/r-help
    PLEASE do read the posting guide
    http://www.R-project.org/posting-guide.html
    and provide commented, minimal, self-contained, reproducible code.
    --
    Dr. Michael Sumner
    Software and Database Engineer
    Australian Antarctic Division
    203 Channel Highway
    Kingston Tasmania 7050 Australia


      [[alternative HTML version deleted]]

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupr-help @
categoriesr
postedJun 15, '16 at 3:43a
activeJun 16, '16 at 2:17a
posts4
users4
websiter-project.org
irc#r

People

Translate

site design / logo © 2017 Grokbase