Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with plot() and of() when the world contains a layer with character values #49

Open
SarahBauduin opened this issue Feb 26, 2024 · 0 comments

Comments

@SarahBauduin
Copy link
Collaborator

Error with plot() when a world has multiple layer and one of the layer contains character values for the patches value.

w1 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4, data = 1:25)
w2 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4, data = rep("sea", 25))
w3 <- stackWorlds(w1, w2)
plot(w3)

Plot works (figure displayed) but returns an error

Warning message:
In FUN(X[[i]], ...) : NAs introduced by coercion

Also of() doesn't work when extracting values from the stacked world on that layer. But work on the layer alone

of(world = w2, agents = cbind(pxcor = 1, pycor = 1))
[1] "sea"
of(world = w3, agents = cbind(pxcor = 1, pycor = 1), var = "w2")
w2 
NA 
Warning message:
In FUN(X[[i]], ...) : NAs introduced by coercion

May cause errors with other functions. Not tested on all functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant