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

Mapping plot_swatch output #12

Open
Lisark45 opened this issue Sep 14, 2022 · 0 comments
Open

Mapping plot_swatch output #12

Lisark45 opened this issue Sep 14, 2022 · 0 comments

Comments

@Lisark45
Copy link

Hi,

I'd like to overlay the output of plot_swatch to a geographical map.
However, M is referenced by grid, not lat and long, nor does it have a crs.

Is there some way of doing this please?

I'm working from the vignette example;

data(africa)
comm <- africa$comm
tree <- africa$phylo
poly <- africa$polys
mypd <- PD(comm, tree)
M <- merge(poly, data.frame(grids=names(mypd), pd=mypd), by="grids")
M <- M[!is.na(M@data$pd),]
head(M)

par(mar=rep(0,4))
plot_swatch(M, values = M$pd, border=NA, leg=3,
            col = hcl.colors(n=20, palette = "Blue-Red 3", rev=FALSE))
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

2 participants
@Lisark45 and others