如何在argonDash仪表板中使用模块
我刚刚发现了这些名为argonR和argonDash的惊人软件包,但不幸的是,到目前为止,我还没有成功地将模块与之一起使用。可能吗 我试着把它关掉,但没用。它在本地工作,但在部署时无法更改选项卡如何在argonDash仪表板中使用模块,r,shiny,R,Shiny,我刚刚发现了这些名为argonR和argonDash的惊人软件包,但不幸的是,到目前为止,我还没有成功地将模块与之一起使用。可能吗 我试着把它关掉,但没用。它在本地工作,但在部署时无法更改选项卡 # rm(list = ls()) library(shiny) library(shinydashboard) library(argonR) library(argonDash) library(magrittr) library(shinyjs) # Modules source("side
# rm(list = ls())
library(shiny)
library(shinydashboard)
library(argonR)
library(argonDash)
library(magrittr)
library(shinyjs)
# Modules
source("sidebar.R", encoding = "utf8")
source("navbar.R", encoding = "utf8")
source("header.R", encoding = "utf8")
source("footer.R", encoding = "utf8")
source("R/mod_home.R", encoding = "utf8")
source("R/mod_stats.R", encoding = "utf8")
source("R/mod_prob.R", encoding = "utf8")
source("R/mod_stat_econ.R", encoding = "utf8")
source("R/mod_econometria.R", encoding = "utf8")
source("R/mod_ML.R", encoding = "utf8")
source("R/mod_quiz.R", encoding = "utf8")
source("R/mod_sobre.R", encoding = "utf8")
# App
ui <- argonDashPage(
title = "TCM",
author = "Guilherme",
description = "Guig's TCM",
sidebar = argonDashSidebar(
vertical = TRUE,
skin = "light",
background = "white",
size = "md",
side = "left",
id = "my_sidebar",
brand_url = "http://www.google.com",
# brand_logo = "https://demos.creative-tim.com/argon-design-system/assets/img/brand/blue.png",
# brand_logo = ,
brand_logo = "https://kdrt.org/sites/default/files/styles/adaptive/public/Rocket%20Radio%20program%20picture.png?itok=-FHCim8R",
argonSidebarHeader(title = "Menu Principal"),
argonSidebarMenu(
argonSidebarItem(
tabName = "home_tab",
style="text-align:center",
"Home"
),
argonSidebarItem(
tabName = "stats_tab",
style="text-align:center",
"Estatística"
),
argonSidebarItem(
tabName = "prob_tab",
style="text-align:center",
"Probabilidade"
),
argonSidebarItem(
tabName = "stat_econ_tab",
style="text-align:center",
"Estatística Econômica"
),
argonSidebarItem(
tabName = "econometria_tab",
style="text-align:center",
"Econometria"
),
argonSidebarItem(
tabName = "ML_tab",
style="text-align:center",
"Machine Learning"
),
argonSidebarItem(
tabName = "quiz_tab",
style="text-align:center",
"Quiz"
),
argonSidebarItem(
tabName = "sobre_tab",
style="text-align:center",
"Sobre"
)
),
argonSidebarDivider(),
argonSidebarHeader(title = "@TCM Versão 0.1")
),
navbar = argonDashNavbar(
argonDropNav(
title = "Powered by R",
# src = "https://demos.creative-tim.com/argon-dashboard/assets/img/theme/team-4-800x800.jpg",
src = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRCLcatfAURCtGHsd71IjruuQqMXjezkwwjZR5inocuNz0imUF5sA",
orientation = "right",
argonDropNavTitle(title = "Este app é formado por"),
argonDropNavItem(
title = "R",
src = "https://www.r-project.org/",
icon = argonIcon("single-02")
),
argonDropNavItem(
title = "RStudio",
src = "https://rstudio.com/",
icon = argonIcon("settings-gear-65")
),
argonDropNavDivider(),
argonDropNavItem(
title = "Guigo's código",
src = "#",
icon = argonIcon("calendar-grid-58")
)
)
),
header = argonDashHeader(
gradient = TRUE,
color = "primary",
separator = TRUE,
separator_color = "secondary"#,
# argonCard(
# title = "Olá, visitante!",
# src = "https://www.linkedin.com/in/guilherme-viegas-1b5b0495/",
# hover_lift = TRUE,
# shadow = TRUE,
# shadow_size = NULL,
# hover_shadow = FALSE,
# border_level = 0,
# # icon = argonIcon("atom"),
# icon = "https://scontent.ffln1-1.fna.fbcdn.net/v/t1.0-9/13669798_1073355219425752_3359245208514920392_n.jpg?_nc_cat=111&_nc_oc=AQk0e2H7_Cjzdx97Vq_sl2v_JrdqSZBK5oFe6Kj6VGu_OKOvO7zFTwta02RVm-Bz8Ck&_nc_ht=scontent.ffln1-1.fna&oh=bad62632b291289b4338d3aec456cbe2&oe=5E2B61E2",
# status = "primary",
# background_color = NULL,
# gradient = FALSE,
# floating = FALSE,
# "Seja muito bem vindo.\nEste é meu cartão, tome."
# )
),
body = argonDashBody(
argonTabItems(
argonTabItem(
tabName = "home_tab",
mod_home_ui("home_ui_1")
),
argonTabItem(
tabName = "stats_tab",
mod_stats_ui("stats_ui_1")
),
argonTabItem(
tabName = "prob_tab",
mod_prob_ui("prob_ui_1")
),
argonTabItem(
tabName = "stat_econ_tab",
mod_stat_econ_ui("stat_econ_ui_1")
),
argonTabItem(
tabName = "econometria_tab",
mod_econometria_ui("econometria_ui_1")
),
argonTabItem(
tabName = "ML_tab",
mod_ML_ui("ML_ui_1")
),
argonTabItem(
tabName = "quiz_tab",
mod_quiz_ui("quiz_ui_1")
),
argonTabItem(
tabName = "sobre_tab",
mod_sobre_ui("sobre_ui_1")
)
)
),
footer = argonDashFooter(
copyrights = "@Guilherme Viegas, 2019",
src = "https://www.linkedin.com/in/guilherme-viegas-1b5b0495/",
argonFooterMenu(
argonFooterItem("Linkedin", src = "https://www.linkedin.com/in/guilherme-viegas-1b5b0495/"),
argonFooterItem("Github", src = "https://github.com/Gui-go"),
argonFooterItem("Facebook", src = "https://www.facebook.com/guilherme.viegas.90"),
argonFooterItem("Instagram", src = "https://demos.creative-tim.com/argon-design-system/index.html")
)
)
)
server <- function(input, output) {
# observeEvent(input$my_sidebar, {
# if (input$my_sidebar != "sobre") {
# updateTabItems(session, inputId = "tabs", selected = "quiz")
# }
# })
callModule(mod_home_server, "home_ui_1")
callModule(mod_stats_server, "stats_ui_1")
callModule(mod_prob_server, "prob_ui_1")
callModule(mod_stat_econ_server, "stat_econ_ui_1")
callModule(mod_econometria_server, "econometria_ui_1")
callModule(mod_ML_server, "ML_ui_1")
callModule(mod_quiz_server, "quiz_ui_1")
callModule(mod_sobre_server, "sobre_ui_1")
}
shinyApp(ui = ui, server = server)
#rm(list=ls())
图书馆(闪亮)
图书馆(shinydashboard)
图书馆(argonR)
图书馆(阿贡达什)
图书馆(magrittr)
图书馆(shinyjs)
#模块
来源(“侧边栏.R”,encoding=“utf8”)
来源(“navbar.R”,encoding=“utf8”)
来源(“header.R”,encoding=“utf8”)
来源(“footer.R”,encoding=“utf8”)
来源(“R/mod_home.R”,encoding=“utf8”)
来源(“R/mod_stats.R”,encoding=“utf8”)
来源(“R/mod_prob.R”,encoding=“utf8”)
来源(“R/mod\u stat\u econ.R”,encoding=“utf8”)
来源(“R/mod_econometria.R”,encoding=“utf8”)
来源(“R/mod_ML.R”,encoding=“utf8”)
来源(“R/mod_quick.R”,encoding=“utf8”)
来源(“R/mod_sobre.R”,encoding=“utf8”)
#应用程序
ui我找到了答案。至于2019年10月,CRAN软件包版本不允许更改选项卡(这是一个bug)。这个错误在他们的Github包版本中得到了纠正,很快也会出现在CRAN上。这只是一个bug,碰巧…这很难帮助解决,因为我们无法复制它。。。您能否仅使用必要的代码创建一个最小的、可复制的示例来重新创建错误?我已经编辑了一些代码,以便尝试使用模块,但软件包的作者已经完成了此代码:也许您可以从他的代码中复制ir。问题是,如果我可以在应用程序中使用模块作为选项卡,就像在任何普通的闪亮应用程序中一样,那就太好了。如果它可以在本地工作,但不能在您的服务器上工作,那么我会假设模块与argon一起工作,错误在您闪亮的服务器上。事实并非如此。我试过简单的代码只是为了确定。我猜这个新的argonDash不能很好地与模块一起工作。在他们的示例中,他们只使用一台服务器,即主应用程序脚本中的服务器。