Skip to content

Commit

Permalink
fixing calculate_spectral_metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
adelegem committed Nov 18, 2024
1 parent 5312682 commit e354a12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/calculate_spectral_metrics.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' red = runif(20000, min = 0, max = 1),
#' red_edge = runif(20000, min = 0, max = 1),
#' nir = runif(20000, min = 0, max = 1))
#' spectral_metrics <- calculate_cv(df,
#' spectral_metrics <- calculate_spectral_metrics(df,
#' wavelengths = c('blue','green','red','red_edge','nir'),
#' rarefaction = TRUE, min_points = 5000, n = 999)

Expand Down Expand Up @@ -183,7 +183,7 @@ calculate_spectral_metrics <- function(pixel_values_df,
sv <- calculate_sv(site_pixel_values, wavelengths = wavelengths)
chv <- calculate_chv_nopca(site_pixel_values, wavelengths, rarefaction = rarefaction, n = n, min_points = min_points)

results <- list(CV = cv, SV = sv, CHV = chv)
results[[site]] <- list(CV = cv, SV = sv, CHV = chv)
}

combined_cv <- dplyr::bind_rows(lapply(results, function(x) x$CV), .id = 'site')
Expand Down
2 changes: 1 addition & 1 deletion man/calculate_cv.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e354a12

Please sign in to comment.