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

Removed from CRAN #15

Open
niekkoelewijn opened this issue Jan 13, 2023 · 3 comments
Open

Removed from CRAN #15

niekkoelewijn opened this issue Jan 13, 2023 · 3 comments

Comments

@niekkoelewijn
Copy link

Dear authors of the ForestGapR packages,

I am currently carrying out a thesis research project about canopy gap dynamics in managed and unmanaged forests, and I was wondering why the ForestGapR package was removed from CRAN, and whether or not you are working on a new version of the package. If the second is the case, when can we expect it to come? Keep me posted on that!

Kind regards,
Niek

@atkinsjeff
Copy link
Collaborator

@niekkoelewijn were you able to install the version from here? And working on fixing the issue now.

@niekkoelewijn
Copy link
Author

Yes I was able to install it via GitHub, thank you

I'm using an adapted version of GetForestGaps in my scripts, that is compatible with a terra SpatRaster chm_layer:

getForestGaps <- function(chm_layer, threshold = 10, size = c(1, 10^4)) {
chm_layer[chm_layer > threshold] <- NA
chm_layer[chm_layer <= threshold] <- 1
gaps <- terra::patches(chm_layer, directions = 8, allowGaps = F)
rcl <- terra::freq(gaps)
rcl[, 3] <- rcl[, 3] * terra::res(chm_layer)[1]^2
z <- terra::classify(gaps, rcl = rcl, right = NA)
z[is.na(gaps)] <- NA
gaps[z > size[2]] <- NA
gaps[z < size[1]] <- NA
gaps <- terra::patches(gaps, directions = 8, allowGaps = F)
names(gaps) <- "gaps"
return(gaps)
}

Perhaps useful for other users that want to use the package, but are working with terra in stead of raster

@mcgregorian1
Copy link

Thanks @niekkoelewijn for the conversion!

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

3 participants