I'm trying to create a histogram of density and I'm having the error: argument 'x' must be numeric. I tried to use (as.numeric(input$d)) instead of just d but got the same error. Does anyone know how to solve this?
server.R
output$hist <- renderPlot({
input$action
if(is.null(input$action))
return(NULL)
else
isolate({
trees3 <- FindTreesCHM(chm(), (as.numeric(input$fws)), (as.numeric(input$minht)))
d <- density(trees3["height"])
plot(d, xlab = "Height", ylab = "Density", main = "")
polygon((as.numeric(input$d)), col = "darkseagreen")
})
})
Thank you a lot! :)