Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```{r sillhouette-plots, echo=FALSE, message=FALSE}
- library(shiny)
- library(cluster)
- library(dplyr)
- ui <- fluidPage(
- wellPanel(
- fluidRow(
- column(4, offset=4,
- numericInput("k", "Number of clusters", min = 2, max = 8, value = 3)
- ))),
- plotOutput("sillhouettes")
- )
- server <- function(input, output, session) {
- output$sillhouettes <- renderPlot({
- sill.model <- pam(mtcars[-1], k = input$k)
- plot(mtcars, which.plots = 2, main = paste0("Sillhouette plot for data, k = ", input$k))
- })
- }
- shinyApp(ui, server)
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement