I'm very new to R Markdown and Shiny, and I'm trying to make a simple interactive html document. I have two data frames that share the same row names (company names), and the rest are percentages based on different measures (each row adds up to 1). What I'd like to have is when people select a company, two bar plots will appear accordingly. I'm able to create a drop-down column but not sure how to add the two charts. Below are my codes:
---
title: "Test"
author: "Z"
date: "March 30, 2018"
output: html_document
runtime: shiny
---
```{r}
Names = c('A','B','C')
Rev = c(-0.2,0.3,0.4)
Mar = c(0.5,0.2,0.1)
Mul = c(0.5,0.2,0.4)
Lev = c(0.2,0.3,0.1)
df1 = data.frame(Names,Rev,Mar,Mul,Lev)
Sal = c(0.4,0.2,0.4)
Ear = c(0.1,0.2,0.3)
Pri = c(0.3,0.1,0.1)
Dev = c(0.2,0.5,0.2)
df2 = data.frame(Names,Sal,Ear,Pri,Dev)
selectInput(inputId = 'Company', label = 'Choose a company',
choices = Names)
```