-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
V.PhyloMaker2 phylo tree error #3
Comments
Thanks for your feedback! It seems there might be a problem because the 'rast' and 'phylo' objects have different numbers of species. I will try to make them equal. If that does not work, could you please provide a reproducible example? This way, I can better understand and fix the issue. |
Appreciate the quick response! If your fix does not work, I'll try to give you a reproducible example (325 tree species of North America!). |
Hope you have been able to make progress. Attached are the files that can reproduce the error. library(terra); library(divraster); library(ape) g = spat.alpha(pge, tf) |
After checking your data, it appears that the issue is indeed the different species names between the spatraster and phylo objects. The phylo object contains the actual species names, while the spatraster object labels the species as "rivmf_nfif3_20k_sXXX". The updated version of the package now specifies this error, and I am including this information in the functions' documentation. You might want to consider running the code below for further details. Thank you! install updated version from githubdevtools::install_github("flaviomoc/divraster", force = TRUE) load packageslibrary(terra); library(divraster); library(ape) load datapge = rast("na_sumPres_ActualStack.tif") apply functionsg = spat.alpha(pge, tf) Error in inputs_chk(bin1 = bin, tree = tree) :Species names in 'bin1' and 'tree' must match.check objectssort(names(pge)) Number of species and their names do not match!check divraster examplesbin1 <- terra::rast(system.file("extdata", "ref.tif", |
Thanks! Must have checked that myself - was under the impression that the numbers was also recorded in the tre file. Appreciate your help and the improved error message! |
Great! |
I'm trying to use spat.alpha/spat.beta on phylo tree generated by V.PhyloMaker2 and getting errors. I don't see any guidance in the divraster documentation on what type of tree to use for tree/plant species. Here is the code
gb = spat.beta(pge, tf)
Error: [focal] test failed
The text was updated successfully, but these errors were encountered: