SlideShare a Scribd company logo
Prepared by VOLKAN OBAN
Some Examples in R:
Drop-Down Combo Boxes in R.
Example 1-
Example 2-
Example 3
library(shiny)
runApp(list(
ui = bootstrapPage(
numericInput('n', 'Enter 3 for condition', 3, 0, 10),
conditionalPanel(condition="input.n==3",
div(style="display:inline-block",
tags$label('Menu1', `for` = 'Sample'),
tags$select(id = 'Sample', class="input-small",
tagList(mapply(tags$option, value = 1:10,
paste0(letters[1:10], 1:10),
SIMPLIFY=FALSE)))
),
div(style="display:inline-block",
tags$label('Menu2', `for` = 'Sample1'),
tags$select(id = 'Sample1', class="input-small",
tagList(mapply(tags$option, value = 1:2,
paste0(letters[1:2], 1:2),
SIMPLIFY=FALSE)))
)
)
, textOutput("cond")
),
server = function(input, output) {
output$cond <- renderText({
if(input$n == 3){
paste0("Sample value selected =", input$Sample, " Sample1 value selected
=",input$Sample1)
}
})
}
))
Some Examples in R.
Example:
require(tcltk)
tclRequire("BWidget")
tt <- tktoplevel()
tkgrid(tklabel(tt,text="What's your favorite fruit?"))
fruits <- c("Apple","Orange","Banana","Pear")
comboBox <- tkwidget(tt,"ComboBox",editable=FALSE,values=fruits)
tkgrid(comboBox)
OnOK <- function()
{
fruitChoice <- fruits[as.numeric(tclvalue(tkcmd(comboBox,"getvalue")))+1]
tkdestroy(tt)
msg <- paste("Good choice! ",fruitChoice,"s are delicious!",sep="")
tkmessageBox(title="Fruit Choice",message=msg)
}
OK.but <-tkbutton(tt,text=" OK ",command=OnOK)
tkgrid(OK.but)
tkfocus(tt)
EXAMPLE:
dygraphs
> library(dygraphs)
> lungDeaths <- cbind(mdeaths, fdeaths)
> dygraph(lungDeaths)
e
Example: Shiny Dashboard.
library(shiny)
library(shinydashboard)
Ref: https://rstudio.github.io/shinydashboard/structure.html
Some Examples in R.
Some Examples in R.
Some Examples in R.
Some Examples in R.
Some Examples in R.
Reference and codes: shiny.rstudio.com/gallery/
Example:
Reference and codes: http://shiny.rstudio.com/gallery/datatables-
demo.html
Reference:
• http://stackoverflow.com/questions/3574114/drop-down-list-implementation-in-r
• http://shiny.rstudio.com/gallery/select-box.html
• http://mcu.edu.tw/~chenmh/teaching/project/r/reference/RTclTkExamples/DropDown.html
• http://shiny.rstudio.com/gallery/

More Related Content

PDF
PHP for Adults: Clean Code and Object Calisthenics
PDF
Object Calisthenics Adapted for PHP
PPTX
Java me lab2-slides (gui programming)
KEY
Object Calisthenics Applied to PHP
PDF
Web 9 | OOP in PHP
PDF
Web 10 | PHP with MySQL
PDF
Web 8 | Introduction to PHP
PDF
Web 4 | Core JavaScript
PHP for Adults: Clean Code and Object Calisthenics
Object Calisthenics Adapted for PHP
Java me lab2-slides (gui programming)
Object Calisthenics Applied to PHP
Web 9 | OOP in PHP
Web 10 | PHP with MySQL
Web 8 | Introduction to PHP
Web 4 | Core JavaScript

What's hot (20)

PDF
Latihan modul prak basis data full
PDF
Web 11 | AJAX + JSON + PHP
PDF
Growing jQuery
PPTX
14. CodeIgniter adaugarea inregistrarilor
PDF
Orlando BarCamp Why Javascript Doesn't Suck
PDF
MySQL Create Table
PPTX
PDF
WordPress: From Antispambot to Zeroize
PDF
Limited return type covariance and argument type contravariance
PDF
Laravel, the right way - PHPConference 2016
PDF
The command dispatcher pattern
PDF
Александр Трищенко: PHP 7 Evolution
PDF
[2019] 아직도 돈 주고 DB 쓰나요? for Developer
PDF
Coding website
PDF
AskTom Office Hours about Database Migrations
PPT
Perl Intro 7 Subroutines
TXT
PPTX
Implicit classes - share the knowledge
PDF
Writing Sensible Code
Latihan modul prak basis data full
Web 11 | AJAX + JSON + PHP
Growing jQuery
14. CodeIgniter adaugarea inregistrarilor
Orlando BarCamp Why Javascript Doesn't Suck
MySQL Create Table
WordPress: From Antispambot to Zeroize
Limited return type covariance and argument type contravariance
Laravel, the right way - PHPConference 2016
The command dispatcher pattern
Александр Трищенко: PHP 7 Evolution
[2019] 아직도 돈 주고 DB 쓰나요? for Developer
Coding website
AskTom Office Hours about Database Migrations
Perl Intro 7 Subroutines
Implicit classes - share the knowledge
Writing Sensible Code
Ad

Similar to Some Examples in R. (10)

PDF
Introduction to scala
PPTX
KEY
ddd+scala
PPTX
Advance Programming Slide lecture 4.pptx
DOCX
PHP record- with all programs and output
PDF
Miracle of std lib
PPT
Scala presentation by Aleksandar Prokopec
PDF
Tuples All the Way Down
PPTX
Uncover and score the usages of the underscore
PDF
1st CI&T Lightning Talks: Writing better code with Object Calisthenics
Introduction to scala
ddd+scala
Advance Programming Slide lecture 4.pptx
PHP record- with all programs and output
Miracle of std lib
Scala presentation by Aleksandar Prokopec
Tuples All the Way Down
Uncover and score the usages of the underscore
1st CI&T Lightning Talks: Writing better code with Object Calisthenics
Ad

More from Dr. Volkan OBAN (20)

PDF
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
PDF
Covid19py Python Package - Example
PDF
Object detection with Python
PDF
Python - Rastgele Orman(Random Forest) Parametreleri
DOCX
Linear Programming wi̇th R - Examples
DOCX
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
DOCX
k-means Clustering in Python
DOCX
Naive Bayes Example using R
DOCX
R forecasting Example
DOCX
k-means Clustering and Custergram with R
PDF
Data Science and its Relationship to Big Data and Data-Driven Decision Making
DOCX
Data Visualization with R.ggplot2 and its extensions examples.
PDF
Scikit-learn Cheatsheet-Python
PDF
Python Pandas for Data Science cheatsheet
PDF
Pandas,scipy,numpy cheatsheet
PPTX
ReporteRs package in R. forming powerpoint documents-an example
PPTX
ReporteRs package in R. forming powerpoint documents-an example
DOCX
R-ggplot2 package Examples
DOCX
R Machine Learning packages( generally used)
DOCX
treemap package in R and examples.
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Covid19py Python Package - Example
Object detection with Python
Python - Rastgele Orman(Random Forest) Parametreleri
Linear Programming wi̇th R - Examples
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
k-means Clustering in Python
Naive Bayes Example using R
R forecasting Example
k-means Clustering and Custergram with R
Data Science and its Relationship to Big Data and Data-Driven Decision Making
Data Visualization with R.ggplot2 and its extensions examples.
Scikit-learn Cheatsheet-Python
Python Pandas for Data Science cheatsheet
Pandas,scipy,numpy cheatsheet
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
R-ggplot2 package Examples
R Machine Learning packages( generally used)
treemap package in R and examples.

Recently uploaded (20)

PPTX
Database Infoormation System (DBIS).pptx
PPTX
Introduction to Knowledge Engineering Part 1
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPTX
Computer network topology notes for revision
PPT
ISS -ESG Data flows What is ESG and HowHow
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPTX
1_Introduction to advance data techniques.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PDF
Introduction to the R Programming Language
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PDF
Mega Projects Data Mega Projects Data
PDF
Introduction to Data Science and Data Analysis
Database Infoormation System (DBIS).pptx
Introduction to Knowledge Engineering Part 1
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Computer network topology notes for revision
ISS -ESG Data flows What is ESG and HowHow
Fluorescence-microscope_Botany_detailed content
STUDY DESIGN details- Lt Col Maksud (21).pptx
1_Introduction to advance data techniques.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Galatica Smart Energy Infrastructure Startup Pitch Deck
Miokarditis (Inflamasi pada Otot Jantung)
Business Ppt On Nestle.pptx huunnnhhgfvu
IBA_Chapter_11_Slides_Final_Accessible.pptx
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Introduction to the R Programming Language
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
climate analysis of Dhaka ,Banglades.pptx
Mega Projects Data Mega Projects Data
Introduction to Data Science and Data Analysis

Some Examples in R.