GithubHelp home page GithubHelp logo

Comments (6)

nikkisharks avatar nikkisharks commented on June 20, 2024 1

from animotum.

ianjonsen avatar ianjonsen commented on June 20, 2024

Hi, You'll have to include the code you are using & some example data that reproduces the error. Without this, I can only guess at what's causing the problem.

Thanks, Ian

from animotum.

nikkisharks avatar nikkisharks commented on June 20, 2024

from animotum.

ianjonsen avatar ianjonsen commented on June 20, 2024

Ok, half-way there. You will have to save your data as a .csv file (eg. using write.csv within R, generate a .csv file from your excel spreadsheet, etc...) and attach it to your reply using the "paperclip" icon at the top right of the "Add a comment" window. Once I have your data then I can reproduce the error and determine what is going wrong.

from animotum.

nikkisharks avatar nikkisharks commented on June 20, 2024

BermudaChloe.csv

Sorry, I replied to the email with the attachment, I guess that doesn't work!

from animotum.

ianjonsen avatar ianjonsen commented on June 20, 2024

There are a few issues going on here. First, you have a mix of uppercase and lowercase variable names so you either have to edit these so they are all lowercase prior to using aniMotum functions or you have to call format_data() and provide the exact variable names, eg:

data <- aniMotum::format_data(BermudaChloe, date = "Date", coord = c("lon", "Lat"))

But this also results in an error because you have missing entries, not classed as NA's in the Date variable:

d$Date
  [1] "2017-08-13 23:35:40" "2017-08-14 10:00:09" "2017-08-15 09:14:24" "2017-08-15 10:17:39" "2017-08-15 10:44:45" "2017-08-16 02:00:38" "2017-08-16 09:03:25" "2017-08-16 22:00:01"
  [9] "2017-08-16 22:00:01" "2017-08-17 07:09:34" "2017-08-17 09:11:36" "2017-08-17 10:29:04" "2017-08-17 10:29:04" "2017-08-17 21:43:33" "2017-08-18 21:03:09" "2017-08-19 02:36:02"
 [17] "2017-08-19 09:34:01" "2017-08-19 19:52:10" "2017-08-20 02:16:22" "2017-08-20 10:55:15" "2017-08-20 22:53:11" ""                    ""                    ""                   
 [25] ""                    "2017-08-25 21:42:11" "2017-08-25 21:59:54" "2017-08-25 22:23:26" "2017-08-26 01:01:35" "2017-08-26 07:10:59" "2017-08-26 09:39:09" "2017-08-26 22:54:58"
 [33] "2017-08-26 23:35:07" "2017-08-27 08:38:59" "2017-08-27 09:09:41" "2017-08-27 11:45:22" "2017-08-27 22:35:36" "2017-08-27 23:07:18" ""                    ""                   
 [41] "2017-08-30 21:20:28" "2017-08-30 22:35:10" "2017-08-30 22:57:21" "2017-08-30 23:05:32" "2017-08-31 08:00:28" "2017-08-31 08:37:00" "2017-08-31 13:21:40" "2017-08-31 20:52:19"
 [49] "2017-08-31 20:52:19" "2017-08-31 22:31:13" "2017-09-01 07:44:57" "2017-09-01 23:44:14" "2017-09-02 00:18:55" "2017-09-02 23:57:48" "2017-09-03 10:23:45" "2017-09-03 21:52:22"
 [57] "2017-09-03 23:04:09" "2017-09-04 02:56:34" "2017-09-04 08:18:46" "2017-09-04 09:42:21" "2017-09-04 18:28:16" "2017-09-04 20:13:17" "2017-09-04 21:40:34" "2017-09-04 23:16:30"
 [65] "2017-09-05 09:29:58" ""                    "2017-09-07 10:02:28" ""                    ""                    ""                    ""                    ""                   
 [73] ""                    ""                    ""                    ""                    ""                    "2017-09-18 01:26:47" "2017-09-18 19:11:10" "2017-09-18 23:59:59"
 [81] "2017-09-19 23:04:55" "2017-09-20 02:24:18" ""                    ""                    ""                    ""                    ""                    ""                   
 [89] ""                    ""                    ""                    ""                    "2017-10-01 00:11:53" "2017-10-01 23:12:49" ""                    ""                   
 [97] ""                    ""                    ""                    ""                    ""                    ""                    ""                    ""                   
[105] ""                    ""                    ""                    ""                    ""                    ""                    ""                    ""                   
[113] ""                    "2017-10-21 10:33:03" ""                    ""                  

So you need to remove these, as all other variables apart from id are NA. Then you can run format_data(), and then fit the SSM:

d <- subset(BermudaChloe, Date != "")

data <- aniMotum::format_data(d, date = "Date", coord = c("lon", "Lat"))
fit <- aniMotum::fit_ssm(data, max = 4, model = "mp", time.step = 24)
plot(fit, "p")

Rplot

But this shows that you have a few fairly large data gaps, which can be problematic for estimating sensible locations and move persistence. Finally, the first and last observed locations are substantially far away from the rest of the observed locations - you can see these in the x and y plot panels above, and both in the map below. Suggesting that these observations may be erroneous (highlighted in red):

aniMotum::map(fit, what = "f")

Rplot01

Hope this helps

from animotum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.