knitr::opts_chunk$set(echo = TRUE)
webshot::install_phantomjs()
library(data.table)
library(dplyr)
library(knitr)
prodopts_file <- system.file("ExtData/", "MODIStsp_ProdOpts.RData", 
                             package = "MODIStsp")
load(prodopts_file)
out_list = list()
ind <- 1 
for (prod in seq_along(prod_opt_list)) {
  prod_data <- prod_opt_list[[prod]]
  for (ver in seq_along(prod_data)) {
    prod_verdata <- prod_data[[ver]]
    out_list[[ind]] <- data.frame(cat01 = prod_verdata[["cat01"]], 
                                  cat02 = prod_verdata[["cat02"]],
                                  Version   = prod_verdata[["v_number"]],
                                  Name = prod_verdata[["prod_fullname"]], 
                                  Resolution = prod_verdata[["native_res"]],
                                  Info  = prod_verdata[["www"]])
    ind <- ind + 1
  }
}
prod_df <- data.table::rbindlist(out_list)

Radiation Budget Variables

cat_products <- subset(prod_df, cat01 == "Radiation Budget Variables")


Land Surface Reflectance

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Land Surface Reflectance") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>%
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution = as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>"))
library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))


Snow Cover

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Snow Cover") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>%
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution =  as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>")) 

library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))


Land Surface Temperature/Emissivity

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Land Surface Temperature/Emissivity") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>% 
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution =  as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>")) 

library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))


BRDF and Albedo

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "BRDF and Albedo") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>% 
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution =  as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>%
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>")) 

# dplyr::select(Name, Version, Resolution, Info)
# knitr::kable(cat2_products)
# tab <- knitr::kable(tab, digits = 1, align = c("l","l","c","c","l"),
#                     col.names = c("Product Code", "Product Name", "Version",
#                                   "Native Resolution", "Info"))
# print(tab, type = "html")
library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))

Radiation

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Radiation") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>% 
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution =  as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>%
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>")) 

# dplyr::select(Name, Version, Resolution, Info)
# knitr::kable(cat2_products)
# tab <- knitr::kable(tab, digits = 1, align = c("l","l","c","c","l"),
#                     col.names = c("Product Code", "Product Name", "Version",
#                                   "Native Resolution", "Info"))
# print(tab, type = "html")
library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))

Ecosystem Variables

cat_products <- subset(prod_df, cat01 == "Ecosystem Variables")


Vegetation Indices

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Vegetation Indices") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>%
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution = as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>"))
library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))


LAI/FPAR

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "LAI/FPAR") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>%
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution = as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>"))

library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))


Evapotranspiration

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Evapotranspiration") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>%
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution = as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>")) 
library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))


Gross Primary Productivity

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Gross Primary Productivity") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>%
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution = as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>")) 

library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))


Net Primary Productivity

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Net Primary Productivity") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>%
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution = as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>")) 

library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))


Vegetation Continuous Cover/Fields

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Vegetation Continuous Cover/Fields") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>%
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution = as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>")) 

library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))

Land Cover Characteristics

cat_products <- subset(prod_df, cat01 == "Land Cover Characteristics")


Thermal Anomalies and Fire

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Thermal Anomalies and Fire") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>%
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution = as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>"))
library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))


Land Cover

library(xtable)
tab <- cat_products %>% 
  dplyr::filter(cat02 == "Land Cover") %>% 
  dplyr::mutate(Code = as.factor(stringr::str_split_fixed(Name, ":", 2)[,1])) %>% 
  dplyr::mutate(Name = as.factor(stringr::str_split_fixed(Name, ":", 3)[,2])) %>%
  dplyr::select(Code, Name, Version, Resolution, Info) %>% 
  dplyr::mutate(Resolution = as.numeric(as.character(Resolution))) %>%  
  dplyr::mutate(Resolution = as.factor(format(Resolution, digits = 2, 
                                              nsmall = 1))) %>% 
  dplyr::mutate(Info = paste0("<a href='", Info,"'>", "Link","</a>"))
library(DT)
DT::datatable(tab, rownames = FALSE, filter = "top", style = "bootstrap",
              escape = -5, options = list(pageLength = 10, searching = TRUE))



ropensci/MODIStsp documentation built on Oct. 16, 2023, 2:34 a.m.