#using a real raster:
file <- system.file('extdata/ndvi-italy.tiff', package='LAIr')
input <- terra::rast(file)
res <- NDVI2LAI(input, category = 'Crop', name = c('Vineyard', 'Barley'), sensor = 'MODIS')
terra::plot(res)
#using a vector
NDVI2LAI(seq(0.5,1,.2), category = 'Mixed', sensor = c('PROBA-V', 'SPOT'))
Run the code above in your browser using DataLab