# NOT RUN {
data("calves")
calves.dateTime<-datetime.append(calves, date = calves$date,
time = calves$time) #create a dataframe with dateTime identifiers for location fixes.
calves.agg<-tempAggregate(calves.dateTime, id = calves.dateTime$calftag,
dateTime = calves.dateTime$dateTime, point.x = calves.dateTime$x,
point.y = calves.dateTime$y, secondAgg = 300, extrapolate.left = FALSE,
extrapolate.right = FALSE, resolutionLevel = "reduced", parallel = FALSE,
na.rm = TRUE, smooth.type = 1) #smooth to 5-min fix intervals.
calves.dist<-dist2All_df(x = calves.agg, parallel = FALSE,
dataType = "Point", lonlat = FALSE) #calculate inter-animal distances at each timepoint.
calves.contact.NOblock<-contactDur.all(x = calves.dist, dist.threshold=1,
sec.threshold=10, blocking = FALSE, equidistant.time = FALSE,
parallel = FALSE, reportParameters = TRUE)
calves.edges<-ntwrkEdges(x =calves.contact.NOblock, importBlocks = FALSE,
removeDuplicates = TRUE)
calves.network1 <- igraph::graph_from_data_frame(d=calves.edges,
directed=FALSE)
igraph::V(calves.network1)$color<- "orange1"
igraph::V(calves.network1)$size <-13
igraph::E(calves.network1)$width <- calves.edges$duration
igraph::E(calves.network1)$color <- "black"
igraph::plot.igraph(calves.network1, vertex.label.cex=0.4,
layout = igraph::layout.circle, main = "Inter-Calf Contacts") #plot the network
# }
Run the code above in your browser using DataLab