R/prior_to_rGEDI/GEDI_sub_merge.R

Defines functions GEDI_sub_merge

#' GEDI json merger
#'
#' This function allows you to merge several GEDI file subsets (json output of GEDIsubsetter)
#' @param inpath characterstring to folder with all files that should be merged
#' @keywords merge
#' @export
#' @examples
#' GEDI_sub_merge()
#'
#' @import rjson
#' @import chron

GEDI_sub_merge <- function(inpath){
  files <- list.files(inpath, full.names = T)
  file_lst <- lapply(files, function (i){
    # i <- files[1]
    jsn <- fromJSON(file = i)
    jsn$add <- GEDI_meta(filenm = basename(i))
    return(jsn)
  })
}
envima/GEDItools documentation built on July 25, 2020, 5:13 p.m.