मैं होगा की तरह के लिए रेखांकन में अपने चमकदार app करने के लिए परिवर्तन रंग (या प्रकाश डाला जा सकता है) जब मैं उन पर होवर करें के साथ माउस. मैं भी उन्हें पसंद करने के लिए केवल उत्पादन की गिनती मेरे ग्राफ के बजाय, गणना और x-मान.
यहाँ है क्या यह की तरह लग रहा है में चमकदार अनुप्रयोग:
स्पष्ट होना करने के लिए, मैं बार है कि मैं कर रहा हूँ पर मँडरा बारी करने के लिए हल्के नीले रंग (या एक काले रंग की रूपरेखा) और करने के लिए ही कहते हैं "गिनती: 61735" कहे बिना "fat_infreq(दौड़): काले".
नीचे, मैं संलग्न है एक प्रतिलिपि प्रस्तुत करने योग्य उदाहरण:
library(shiny)
library(ggplot2)
library(plotly)
library(data.table)
library(shinythemes)
library(forcats)
require(stringi)
require(stringr)
library(scales)
library(ggthemes)
library(plyr)
library(dplyr)
library(readr)
library(tidyr)
library(ggthemes)
library(forcats)
library(xtable)
library(googledrive)
library(googlesheets4)
library(gridExtra)
library(lubridate)
library(DT)
library(vroom)
library(utf8)
library(tableHTML)
library(bslib)
library(devtools)
library(readr)
library(RColorBrewer)
ethnicity <- c("Hispanic", "Non-hispanic","Hispanic","Hispanic","Hispanic","Hispanic","White","White","White","White",
"White","Hispanic","Hispanic", "Hispanic","Hispanic","Hispanic","White","White","White","White")
filtered_data <- data.frame(ethnicity)
ui <- fluidPage(
titlePanel("Example"),
mainPanel(
plotlyOutput("ethnicity_barplot")
)
)
server <- function(input, output) {
output$ethnicity_barplot <- renderPlotly({
ggplotly({
ethnicity_barplot <-ggplot(data = filtered_data, aes(x = fct_infreq(ethnicity))) +
geom_bar() +
xlab("Ethnicity") +
ylab("Number of People") +
labs(title = "Ethnicity of Defendants in New York State Courts") +
geom_bar(fill = "#327EC2") +
theme(panel.background = element_rect(fill = 'white'))+
theme(plot.background = element_rect(fill = 'white'))+
theme(plot.title = element_text(hjust = 0.5))+
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
geom_text(stat='count', aes(label=..count..), vjust = -.3)
ethnicity_barplot
})
})
}
# Run the application
shinyApp(ui = ui, server = server)
(नहीं सभी संकुल की जरूरत है, सिर्फ याद नहीं कर सकते हैं कि लोगों को कर रहे हैं)