第6集-shiny小明算命師(下)-第1季完結篇
Human Resource Teller
6.1 shiny小明算命師-六大特性
6.2 下載檔案與shiny架構
6.3 ui設定
6.4 server設定
6.5 Rmd設定
6.6 結論
整合敘述統計資料分析
整合推論統計資料分析
整合機器學習進行人力資源預測
下載客製化HTML檔案
下載客製化WORD檔案
輕鬆更換為企業人力資源料集
下載shiny 小明算命師 app
https://github.com/rwepa/business_analytics/tree/main/r-shiny-06-hr-teller
shiny app 架構
ui <- dashboardPage(
dashboardHeader(title = "RWEPA | shiny小明算命師-v23.03.25, http://rwepa.blogspot.com/",
titleWidth = 750),
dashboardSidebar(
sidebarMenu(
menuItem(text="資料特性", tabName = "datasummary", icon = icon("sunglasses", lib = "glyphicon")),
menuItem(text="資料明細", tabName = "dataview", icon = icon("list", lib = "glyphicon")),
...
)
),
dashboardBody(
tabItems(
tabItem(tabName = "datasummary",
fluidRow(
box(
title = "資料摘要",
solidHeader = TRUE,
width = 12,
collapsible = TRUE,
verbatimTextOutput("Summary"),
),
box(
title = "資料結構",
...
)
)
),
tabItem(
),
...
) # end for tabItems
) # end for dashboardBody
) # end for ui
載入圖片 - renderImage函數
HTML下載 - downloadHandler函數
# HTML下載
output$download_report_html <- downloadHandler({
content = function(file) {
# 複製 Rmd 至暫存資料夾
tempReport <- file.path(tempdir(), "hr_teller_report_html.Rmd")
file.copy("data/hr_teller_report_html.Rmd", tempReport, overwrite = TRUE)
# 設定參數(params)並傳輸至 Rmd文件, 參數使用 list資料物件.
params <- list(para_title = input$hr_title,
para_producer = input$hr_producer,
para_headdata = input$hr_headdata,
para_str = input$hr_str,
para_evaluation = input$hr_evaluation,
...,
para_prediction = hr_prediction)
# 編譯(Knit)文件, 傳遞參數串列(params list)並評估其結果.
rmarkdown::render(tempReport,
output_file = file,
params = params,
envir = new.env(parent = globalenv())
)
}
})
HTML Rmd檔案
WORD docx檔案: hr_teller_report_docx.Rmd
---
output: html_document
params:
para_title: NA
para_producer: NA
para_headdata: NA
para_str: NA
para_evaluation: NA
para_project: NA
para_hours: NA
para_company: NA
para_satisfication: NA
para_accident: NA
para_promotion: NA
para_role: NA
para_salary: NA
para_prediction: NA
---
# 主題: `r params$para_title`
# 製表: `r params$para_producer`
熟悉 shiny, shinydashboard 互動式資料分析套件
熟悉 readr, dplyr, ggcorrplot, ggplot2, randomForest, caret, pROC 套件
提供shiny銷售儀表板
規劃與製作流程
提供shiny人力資源儀表板
規劃與製作流程
R與小明算命師(下) …第1季完結篇