Xinxin Yang's avatar
Xinxin Yang committed
res_b <- market_balance(balance_detailed_Baseline)
res_S <- market_balance(balance_detailed_Scenario)

oil_cake_market_baseline <- res_b[[1]]
other_baseline <- res_b[[2]]
oil_cake_market_Scenario <- res_S[[1]]
other_Scenario <- res_S[[2]]

oil_cake <- output_df(oil_cake_market_baseline,oil_cake_market_Scenario)
# %>% rapply( f=function(x) ifelse(is.nan(x),"-",x), how="replace" )

cereals <- output_df(other_baseline,other_Scenario)
# %>% rapply( f=function(x) ifelse(is.nan(x),"-",x), how="replace" )

oil <- nicetable(oil_cake,"baseline for oil and cake markets") %>%
  tab_footnote(
    locations = cells_stub(rows = c(2)),
    footnote = md("Destilled dried grains from bio-ethanol processing")
  )%>%
  gtsave(
    "oil_cake.html", inline_css = FALSE,
    path = outdata.dir)

cereals <- nicetable(cereals,"baseline for cereals, sugar, and meat markets")%>%
  gtsave(
    "cereals.html", inline_css = FALSE,
    path = outdata.dir)
#
webshot(paste0(outdata.dir,"/oil_cake.html"),paste0(outdata.dir,"/png/","oil_cake.png"),
        vwidth = 1100)

webshot(paste0(outdata.dir,"/cereals.html"),paste0(outdata.dir,"/png/","cereals.png"),
        vwidth = 1100)