tests/testthat/test.angle.R

context("angle")
test_that("angle",{
  expect_equal(angle(move(rep(0,10), 0:9, Sys.time()+1:10, proj=CRS("+proj=longlat"))), rep(0,9))
  expect_equal(angle(move(0:9,rep(0,10), Sys.time()+1:10, proj=CRS("+proj=longlat"))), rep(90,9))
  expect_equal(angle(move(9:0,rep(0,10), Sys.time()+1:10, proj=CRS("+proj=longlat"))), rep(-90,9))
  expect_equal(angle(move(9:0,rep(0,10), Sys.time()+1:10, proj=CRS("+proj=longlat"), animal=gl(2,5))), list(X1=rep(-90,4),X2=rep(-90,4)))
  })

Try the move package in your browser

Any scripts or data that you put into this service are public.

move documentation built on Nov. 17, 2017, 8:07 a.m.