SEEG-Oxford / movement

R package containing useful functions for the analysis of movement data in disease modelling and mapping
20 stars 16 forks source link

Movement issue 61: implement plot method for movement_model object #85

Closed KathrinTessella closed 9 years ago

KathrinTessella commented 9 years ago

Using the functionality provided by Nick (see https://github.com/SEEG-Oxford/movement/pull/60)

@goldingn : when trying to plot the movement_model from the example, I receive various warnings. Can this be caused by passing over matrices?

# get location data
data(kenya)
kenya10 <- raster::aggregate(kenya, 10, sum)
net <- getNetwork(kenya10, min = 50000)
locationData <- data.frame(location = net$locations, population = net$population, x = net$coordinate[,1], y = net$coordinate[,2])
class(locationData) <- c('data.frame', 'location_dataframe')
# simulate movements (note the values of movementmatrix must be integer)
predictedMovement  <- predict(originalRadiation(theta = 0.1), locationData, symmetric = TRUE)
movementMatrix <- predictedMovement$movement_matrix
# fit a new model to these data
movement_model <- movement(movementMatrix ~ locationData, radiationWithSelection(theta = 0.5))
# print and plot model output
print(movement_model) 
plot(movement_model)
codecov-io commented 9 years ago

Current coverage is 66.14%

Merging #85 into master will decrease coverage by -1.01% as of 4516342

@@            master     #85   diff @@
======================================
  Files            1       1       
  Stmts          685     697    +12
  Branches         0       0       
  Methods          0       0       
======================================
+ Hit            460     461     +1
  Partial          0       0       
- Missed         225     236    +11

Review entire Coverage Diff as of 4516342

Powered by Codecov. Updated on successful CI builds.

goldingn commented 9 years ago

See my PR to your PR...

KathrinTessella commented 9 years ago

PR to address issue https://github.com/SEEG-Oxford/movement/issues/61