inst/tests/test-to_kml.R

context("to_kml.R")

test_that("tests",{
  a <- matrix( 0,nrow=4,ncol=4)
  a[1,2] <- a[1,3] <- a[2,3] <- a[3,4] <-1
  a <- a + t(a)
  
  rownames(a) <- c("Olympia","St. Louis", "Ames","Richmond")
  
  graph <- as.popgraph( a )
  
  expect_that( to_kml( "bob" ), throws_error() )
  expect_that( to_kml( graph ), throws_error() )
  
  V(graph)$Latitude <- c( 47.15, 38.81, 43.08, 37.74 )
  V(graph)$Longitude <- c(-122.89,-89.98, -93.47, -77.16 )
  
  ret <- to_kml(graph)
  
  expect_that( ret, is_a("character")) 
  
  
  
})

Try the popgraph package in your browser

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

popgraph documentation built on April 14, 2017, 9:58 p.m.