tgoodbody/sgsR

Double plotting histogram in calculate_representation

Closed this issue · 1 comments

When plot=T for calculate_representation, the histogram is plotted twice (for RStudio).

Was able to replicate using the sample code, but adding plot=T:

#--- load ALS metrics from sgsR internal data ---#
r <- system.file("extdata", "mraster.tif", package = "sgsR")
#--- read ALS metrics using the terra package ---#
mraster <- terra::rast(r)
#--- perform stratification ---#
sraster <- strat_kmeans(
mraster = mraster$zq90,
nStrata = 6)

--- create existing sample network ---###

#--- simple random sampling ---#
existing <- sample_srs(
raster = mraster$zq90,
nSamp = 100
)
#--- calculate representation ---#
calculate_representation(
sraster = sraster,
existing = existing,
plot = T
)

Thanks @rymac17. Ive fixed this (was an issue with returning a list) and will push with some other updates shortly.