2つのDygraphビジュアルが1つの範囲セレクタで制御される光沢のあるアプリケーションを構築しようとしています。私はどこから始めるべきか正確には分からないし、これがボックス外では行えないものと仮定している。両方のスライダーを制御する別のパッケージが必要ですか?2つのグラフに範囲セレクタを接続
ui.R
library(shiny)
library(dygraphs)
shinyUI(fluidPage(
titlePanel("Education"),
sidebarLayout(
sidebarPanel(
br("test")
),
mainPanel(
dygraphOutput("dygraph1"),
dygraphOutput("dygraph2")
)
)
))
server.R
library(shiny)
library(dygraphs)
df_education <-
read.csv("C:/Users/adarvishian/Documents/rworking/dygraphtest/education.csv")
education_subset <- df[c(12:55),c(3,8:11)]
w1 = 0.25
w2 = 0.25
w3 = 0.25
w4 = 0.25
education_subset$Index = w1*education_subset$Secondary.school.enrollment+w2*education_subset$Primary.school.enrollment+w3*education_subset$Preprimary.school.enrollment+w4*education_subset$Tertiary.school.enrollment
index_edu<- education_subset[,c(1,6)]
function(input, output){
output$dygraph1 <- renderDygraph({
dygraph(education_subset, main = "Education Components") %>%
dyRangeSelector()
})
output$dygraph2 <- renderDygraph({
dygraph(index_edu, main = "Education Index") %>%
dyRangeSelector()
})
}
データ
https://github.com/adarvishian/dygraphtest.git
これが鍵でした!ありがとう! – adarvishian