Çıktılar

R ile Shiny Kullanarak Web Uygulamaları Geliştirme

Kaelen Medeiros

Data Scientist

Render işlevleri

ui <- fluidPage(
  textInput("name", "Bir ad girin:"),
  selectInput("animal", "Köpek mi kedi mi?", choices = c("dogs", "cats")),
  textOutput("question"),
  textOutput("answer")
)

server <- function(input, output, session) {
  output$question <- renderText({
    paste("Köpekleri mi kedileri mi tercih edersiniz,", input$name, "?")
  })
  output$answer <- renderText({
    paste("Ben", input$animal, "tercih ederim!")
  })
}
R ile Shiny Kullanarak Web Uygulamaları Geliştirme

Diğer render işlevleri

R ile Shiny Kullanarak Web Uygulamaları Geliştirme

Output işlevleri

ui <- fluidPage(
  textInput("name", "Bir ad girin:"),
  selectInput("animal", "Köpek mi kedi mi?", choices = c("dogs", "cats")),

textOutput("question"), textOutput("answer")
)
R ile Shiny Kullanarak Web Uygulamaları Geliştirme

Diğer output işlevleri

  • tableOutput() veya dataTableOutput
  • imageOutput()
  • plotOutput()
R ile Shiny Kullanarak Web Uygulamaları Geliştirme

Shiny dışı output ve render işlevleri

library(shiny)
library(babynames)

ui <- fluidPage(
  DT::DTOutput("babynames_table")
)

server <- function(input, output){
  output$babynames_table <- DT::renderDT({
    babynames %>% 
      dplyr::slice_sample(prop = .1) %>%
      DT::datatable()
  })
}

shinyApp(ui = ui, server = server)

babynames veri setinin rastgele %10'unu gösteren etkileşimli bir veri tablosu

R ile Shiny Kullanarak Web Uygulamaları Geliştirme

Hadi pratik yapalım!

R ile Shiny Kullanarak Web Uygulamaları Geliştirme

Preparing Video For Download...