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 in as.vector(x, "character") : cannot coerce type 'closure' to vector of type 'character' #6

Open
kamaulindhardt opened this issue Jul 13, 2021 · 2 comments

Comments

@kamaulindhardt
Copy link

When I run this code in the PNV tutorial I get the error: Error in as.vector(x, "character") : cannot coerce type 'closure' to vector of type 'character'

grid1km$cool.mixed.forest <- biome1km$predictions[, 
                        which(attr(biome1km$predictions, "dimnames")[[2]] == "cool.mixed.forest")]

library(devtools)
# install_github("envirometrix/plotKML", force = TRUE)
# install_github("envirometrix/plotKML", ref = "stars")
# install.packages("plotKML")
library(terra)
library(plotKML)



plotKML(grid1km["cool.mixed.forest"], 
        file.name = "Biome00k_M_cool.mixed.forest_T9998.kml", 
        folder.name = "cool.mixed.forest",
        raster_name = "Biome00k_M_cool.mixed.forest_T9998.png",  
        colour_scale=SAGA_pal[[10]])

What can be the problem?

@agila5
Copy link
Collaborator

agila5 commented Jul 13, 2021

Hi! I'm not sure I can answer your question but I think it would be great if you could produce a reproducible example (i.e. provide the data, all the packages and so on).

@kamaulindhardt
Copy link
Author

Hi @agila5 ,

Thank you for responding on my issue. Yes of course.

I am basically following the PNV tutorial by Hengl et al. from their PNV maps, see here https://github.com/Envirometrix/PNVmaps

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