Skip to content

aem.time send a warning and an error when printing results #27

Description

@guiblanchet

This is a slightly tricky problem because, if I run the first line of the example code of the aem.time function :

out <- aem.time(20, moran = TRUE)

There is the following warning :

Warning messages:
1: In mat2listw(mat01) :
style is M (missing); style should be set to a valid value
2: In mat2listw(mat01) :
no-neighbour observations found, set zero.policy to TRUE;
this warning will soon become an error

But there are no error. However, when calling the object out, there is the following error message :

Error in print.listw(x) :
regions with no neighbours found, use zero.policy=TRUE

After a bit of digging and some clarification from r-spatial/spdep#136, found that the warnings and error can be solved by changing L134 of the aem.time function from

lw <- mat2listw(mat01)

to

lw <- mat2listw(mat01, style = "W", zero.policy = TRUE)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions