installing ctmm

16 views
Skip to first unread message

Nanette Reece

unread,
Jun 3, 2024, 1:29:34 PMJun 3
to ctmm R user group
Dear All,

I have not touched R in 3 years.  The code I have used to work.  But, now I get error messages with rtools, shiny, move packages.  I installed R 4.1.3 as an error with shiny stated it was built on that version.  I found a website that stated these packages needed to be loaded:  install.packages(c("Matrix", "mgcv", "splines", "base")).  Still no luck.  I realize a lot may have changed in 3 years, but need help.  I am including my old script.  Thanks, Nanette.

library(move)

library(shiny)

library(lazyeval)

 

library(reshape2)

library(ctmm)

library(rgdal)

library(sp)

library(ggplot2)

setwd("D:/HoofstockAnalysisSSD/Ikh Nart Hoofstock/INHoofstockHR2019/HomeRanges")

cred <- movebankLogin()

username: x

password:y

mgaz<-getMovebankData(study="Hoofstock in IN",animalName="44706",login=cred)  #USE THIS FOR DATABASE WITH MULTIPLE ANIMALS"

mgaz<-getMovebankData(study="ggin393032",login=cred)

 

1636110 <- getMovebankData(study="arg1636110",

                                  login=cred,timestamp_start="2015060100000",

                                  timestamp_end="2015083100000")

 

mgaz <- getMovebankData(study="ggin42287",

                             login=cred,timestamp_start="2017010100000",

                             timestamp_end="2017123100000")

 

mgaz30<-subset(MASTER16361,Seas==30)

 

mgaz<-as.telemetry(study="Hoofstock in IN", ID=44699)

mgaz<-as.telemetry(gg39312)

 

mgaz<-as.telemetry(mgaz)

plot(mgaz)

 

vg.mgaz<-variogram(mgaz)

plot(vg.mgaz)

plot(vg.mgaz,fraction=0.005)  ###

variogram.fit(vg.mgaz)

fitted.mods<-ctmm.select(mgaz,CTMM=GUESS,verbose=TRUE)

summary(fitted.mods)

ouf<-fitted.mods

ouf

ouf<-fitted.mods[[2]]

 

ouf

 

akde.mgaz<-akde(mgaz,CTMM=ouf)

summary(akde.mgaz)

plot(mgaz,UD=akde.mgaz)

writeShapefile(akde.mgaz,".",file=39303295,level.UD=0.95)

 

 


Christen Fleming

unread,
Jun 10, 2024, 6:52:43 PMJun 10
to ctmm R user group
Hi Nanette,

Nice to hear from you.
  • rgdal was removed from CRAN last year. Don't load that package.
  • variogram.fit() still works, but ctmm.guess() is now what is recommended.
  • writeShapefile() is replaced with writeVector() now that rdgal is depreciated.
Best,
Chris
Reply all
Reply to author
Forward
0 new messages