0

I am new to r-programming and recently completed the Google Analytics Course through my job. To complete the final part of the course (CAPSTONE) project, my company have decided to give us small projects that can showcase what we have learned. I was recently given my project and am creating a dashboard. I have been so happy with the progress I've made. Watching videos and reading sites like this has been invaluable. With that said, I have run into a snag I just can't seem to figure out. On my .sidebar I have a drop down state list and a dateRangeinput box. I would like to include a drop down list of 7 data types that displays and allows the user to make a choice which then appears in the box.

I've watch quite a few videos and lots of reading but can't piece this one together. I see lots of info about ui, servers and an existing csv file or ref to a site. Here is what I have written, it won't execute. It is throwing an error message of:

selectInput("datatype", strong(“Data Type”), c(“Financial Data”, “Unit Statistical Data”, “Policy Data”, “Medical Data”, “Indemnity Data”, “Detailed Claim Information (DCI)”, “Virginia Only”)

Error: unexpected symbol in "selectInput("datatype", strong(\u201cData"

Here is my code starting at the top and a little pass the line where I am getting the error. Any help would be much appreciated.

title: "CRC Report Card" runtime: shiny output: flexdashboard::flex_dashboard: orientation: rows vertical_layout: fill source_code: embed

library(flexdashboard)

Dashboard

Column {.sidebar data-width=300}

Search

selectInput("dummy", strong("Select Month"), choices = month.name)
dateRangeInput("date", strong("Date Range"), start = "NULL", end = "NULL", min = "NULL", max = "NULL")

dateRangeInput(inputId = "date", strong("Data Type"), start = "NULL", end = "NULL", min = "NULL", max = "NULL")

selectInput("datatype", strong(“Data Type”), c(“Financial Data”, “Unit Statistical Data”, “Policy Data”, “Medical Data”, “Indemnity Data”, “Detailed Claim Information (DCI)”, “Virginia Only”)

Column {data-width=700}

Success

valueBox(175, caption = "success", color = "success", icon = "fa-bar-chart", href = "#Summary details")

I have watched instructional videos and read instructional manuals.
  • Welcome to stack overflow! I just wanted to try to clarify what you're hoping to do. Are you aiming to provide a filtered view of a single data object (like a single table) by selecting a "data type" from the dropdown? – Reed Merrill Jul 12 '23 at 03:49
  • This might not be enough (as it is hard to judge without everything present) but I'd start by removing `strong`, so `selectInput("datatype", “Data Type”, c(“Financial Data”, “Unit Statistical Data”, “Policy Data”, “Medical Data”, “Indemnity Data”, “Detailed Claim Information (DCI)”, “Virginia Only”)`. I hope that helps you. – p0bs Jul 12 '23 at 08:19
  • Thank you for your help! Yes, I believe so. I want it to function the way the "Select Month" drop down works. When I click in the box, a complete list of all months display for the user to select. Sorry, I can't be more clear I am not very fluent in r programming but that is the best example of what I am looking to do. I don't have a file saved in my project with the data types list so I am wondering if I need to add a file first? I would prefer without a file if possible. – Natasha Prince Jul 13 '23 at 21:49
  • I have to learn how to use this site a little better. I see others upload their source code but when I tried it said too big, so I couldn't post it. I wanted to let you know I figured it out. There are so many different ways of getting an output, it's hard to know what will work. However, I kept at it trying different examples and this code worked: ```{r} selectInput("dummy", strong("Select Data Type"), choices = list("Finanicial Data", "Unit Statistical Data", "Policy Data", "Medical Data", "Indemnity Data", "DCI Data", "Virginia Only")) ``` – Natasha Prince Jul 14 '23 at 03:33

0 Answers0