# NOT RUN {
# Define file names
ex_in <- system.file(
"extdata/out/S2A2A_20170703_022_Barbellino_BOA_10.tif",
package = "sen2r"
)
# Run function
ex_out <- s2_rgb(
infiles = ex_in,
rgb_bands = list(c(11,8,4),c(9,5,4)),
scaleRange = list(c(0,7500), matrix(c(rep(0,3),8500,6000,4000),ncol=2)),
outdir = tempdir(),
compress = 50
)
ex_out
# Show output
oldpar <- par(mfrow = c(1,3), mar = rep(0,4))
image(stars::read_stars(ex_in), rgb = 4:2, maxColorValue = 3500)
image(stars::read_stars(ex_out[1]), rgb = 1:3)
image(stars::read_stars(ex_out[2]), rgb = 1:3)
par(oldpar)
# }
Run the code above in your browser using DataCamp Workspace