Shiny

How to color the slider in shiny to the right of the value instead of to the left?

微笑、不失礼 提交于 2021-02-10 17:53:29
问题 I am building an app with shiny and use a slider pretty much as the one shown in Shiny gallery (http://shiny.rstudio.com/gallery/slider-bar-and-slider-range.html). By default it gets coloured blue to the left of the chosen value (in this example from 0 to 50). Is there a way to get it coloured to the right of the chosen value: e.i. from 50 to 100? The reason I would like to do it, is that the user should read it as "all values from the threshold to max", so colouring from the min to the

Silhouette plot is not working for more than 200 rows of data

旧巷老猫 提交于 2021-02-10 16:21:17
问题 I am trying to plot the silhouette for my k-means, using shiny. Below is the piece of code: dissE <- daisy(pima_diabetes_kmean[, c(input$models_to_consider)]) dE2 <- dissE ^ 2 sk2 <- silhouette(k.means.fit.knn()$cl, dE2) plot(sk2) It results in the following plot, where clusters are missing: However, if I change the code to use only 200 rows of data (or use window() ), it does work. But I do not want my results in a separate window, as I am using shiny. I want the results to be on the same

Silhouette plot is not working for more than 200 rows of data

╄→гoц情女王★ 提交于 2021-02-10 16:19:54
问题 I am trying to plot the silhouette for my k-means, using shiny. Below is the piece of code: dissE <- daisy(pima_diabetes_kmean[, c(input$models_to_consider)]) dE2 <- dissE ^ 2 sk2 <- silhouette(k.means.fit.knn()$cl, dE2) plot(sk2) It results in the following plot, where clusters are missing: However, if I change the code to use only 200 rows of data (or use window() ), it does work. But I do not want my results in a separate window, as I am using shiny. I want the results to be on the same

local image in shiny app without img(src())?

别说谁变了你拦得住时间么 提交于 2021-02-10 15:14:22
问题 I would like to include a local image file in my shiny app, following these instructions: Embedding Image in Shiny App However, my IT networks security, for some reason, prevents R from reading that image. I can confirm it is an IT security blockage, because the same exact code and file/directory structure works when I move to another computer. It is also strange, because I am able to read other files from that folder, because other commands like read.csv() are not blocked. I dont know what

Adjust so that the condition panel appears only when a correct file is loaded

£可爱£侵袭症+ 提交于 2021-02-10 14:44:42
问题 I inserted a condition panel so that as soon as the file is loaded by fileInput. It is working, however, I would like this panel to be shown only when the correct file is loaded. As it is, even with the wrong format files, the condition panel appears, as shown in the image. Can someone help me?? The executable code is below: Thank you! library(shiny) library(shinyWidgets) library(ggplot2) library(shinythemes) library(rdist) library(openxlsx) library(geosphere) library(rgdal) function.cl<

Sorting of Bars-ggplot2 in shiny

你说的曾经没有我的故事 提交于 2021-02-10 14:44:37
问题 Please find the code below for a shiny App using ggplot2, I do not know how to sort them inside the server.R code. WIth the below code I am able to display the bar chart and change it but ordering the data seems to be an issue. ui.R library(shiny) library(ggplot2) shinyUI(fluidPage( column(12,offset=5, titlePanel("Template Type by Hours")), br(), h6(textOutput("text1")), fluidRow( column(4,offset=0, wellPanel( selectInput("var","Hours", choices = colnames(sum1[2:8]),selected ="hrs_0to1")))),

Place Plotly Bar Chart and Box Plot in Front of Line Traces

那年仲夏 提交于 2021-02-10 14:26:36
问题 I have created subplots in Plotly that each contain a bar chart (or boxplot ) and three trace lines. I have created traces at y= 1,2,3 to act as ablines like in ggplot . What the plots look like: and . Problem: I want to have it so the bars of the bar chart are in front of the trace lines so you should only be able to see the trace lines in between the bars. My code currently: (I have excluded the code that generates the subplots as I don't think it is needed) generate_plotly_barPlot <-

Place Plotly Bar Chart and Box Plot in Front of Line Traces

て烟熏妆下的殇ゞ 提交于 2021-02-10 14:25:42
问题 I have created subplots in Plotly that each contain a bar chart (or boxplot ) and three trace lines. I have created traces at y= 1,2,3 to act as ablines like in ggplot . What the plots look like: and . Problem: I want to have it so the bars of the bar chart are in front of the trace lines so you should only be able to see the trace lines in between the bars. My code currently: (I have excluded the code that generates the subplots as I don't think it is needed) generate_plotly_barPlot <-

Error: non-numeric argument to binary operator

 ̄綄美尐妖づ 提交于 2021-02-10 14:08:42
问题 Good Day, making application in RStudio/Shiny is very new to me and I am working with a project in which an external file is to be used as the input data. Here is my CSV: my supposed to be app: So the user insert a csv with appliance name in row 1 and their wattage in row 2 just like in the picture above, then the selectInput will be updated. The user choose what appliance and hours of usage then it will be calculated for its cost Here is my server code: server <- function(input,output

How to Truncate text in DataTable in R Shiny?

耗尽温柔 提交于 2021-02-10 07:44:50
问题 I am using DataTable in Rshiny app to display the content of the Dataframe. But one element of the dataframe is of text, can have characters more than 1000. When I am displaying the datatable it shows all the text. I want to truncate it to first 250 characters and when hover it should show the full text. How can I do that? ui.r shinyUI(fluidPage( theme = shinythemes::shinytheme("flatly"), titlePanel("title"), sidebarLayout( sidebarPanel( width=0 ), mainPanel( width=12, tabsetPanel(tabPanel(