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

ext=c(1,2,1,2) within plotRGB returns error #1228

Closed
DaveEdge1 opened this issue Jul 11, 2023 · 2 comments
Closed

ext=c(1,2,1,2) within plotRGB returns error #1228

DaveEdge1 opened this issue Jul 11, 2023 · 2 comments

Comments

@DaveEdge1
Copy link

reproducible snippet:

"
coreImg <- terra::rast("https://github.com/nickmckay/specimR/raw/development/data/CORE_XYZ.tif")
terra::plotRGB(coreImg, r=2, g=4, b=6, stretch = "hist")
#plots without error
terra::plotRGB(coreImg, r=2, g=4, b=6, stretch = "hist", ext=c(1,2,1,2))
Error in if (hadWin) { : the condition has length > 1
"

I believe this error is new with the most recent update to Rcpp.

packageVersion("terra")
[1] ‘1.7.39’
packageVersion("Rcpp")
[1] ‘1.0.11’

OS: Windows 10

@DaveEdge1 DaveEdge1 changed the title ext=ext(c(445, 690, 13084, 16789)) within plotRGB returns error ext=c(1,2,1,2) within plotRGB returns error Jul 11, 2023
@DaveEdge1
Copy link
Author

This error did not occur after I reverted to terra 1.7.3 and Rcpp 1.0.9.

Also, ext=c(368, 779, 13147, 13193) provides a valid cropping

@rhijmans
Copy link
Member

Thanks. I can now (again) do

terra::plotRGB(coreImg, r=2, g=4, b=6, stretch = "hist", ext=c(1200,1287,13150,13217))

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