Creating a graph based on user inputted values

I would like to create a graph that is based upon user input. So the user will enter a value based on V1 and will show the values for v9

library(tidyverse)
library(ggplot2)
library(dplyr)
library(RColorBrewer)
library(cronR)
library(miniUI)
library(shiny)
library(shinyFiles)
library(pdftools)
library(tm)
#> Loading required package: NLP
#> 
#> Attaching package: 'NLP'
#> The following object is masked from 'package:ggplot2':
#> 
#>     annotate
library(xlsx)
#> Warning in system("/usr/libexec/java_home", intern = TRUE): running command
#> '/usr/libexec/java_home' had status 1
#> Error: package or namespace load failed for 'xlsx':
#>  .onLoad failed in loadNamespace() for 'rJava', details:
#>   call: dyn.load(file, DLLpath = DLLpath, ...)
#>   error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so':
#>   dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
#>   Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
#>   Reason: image not found
library(stringr)
library(plyr)
#> -------------------------------------------------------------------------
#> You have loaded plyr after dplyr - this is likely to cause problems.
#> If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
#> library(plyr); library(dplyr)
#> -------------------------------------------------------------------------
#> 
#> Attaching package: 'plyr'
#> The following objects are masked from 'package:dplyr':
#> 
#>     arrange, count, desc, failwith, id, mutate, rename, summarise,
#>     summarize
#> The following object is masked from 'package:purrr':
#> 
#>     compact
library(lubridate)
#> 
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:plyr':
#> 
#>     here
#> The following object is masked from 'package:base':
#> 
#>     date
library(openxlsx)
library(data.table)
#> 
#> Attaching package: 'data.table'
#> The following objects are masked from 'package:lubridate':
#> 
#>     hour, isoweek, mday, minute, month, quarter, second, wday,
#>     week, yday, year
#> The following objects are masked from 'package:dplyr':
#> 
#>     between, first, last
#> The following object is masked from 'package:purrr':
#> 
#>     transpose
library(readtext)
#> Error in library(readtext): there is no package called 'readtext'
library(reprex)
library(rio)
install.packages("reprex")
#> 
#> The downloaded binary packages are in
#>  /var/folders/jk/r5tw734j3sb774yj7l_s28lm0000gn/T//RtmpJ0Prkj/downloaded_packages
NewRAO <- data.frame(stringsAsFactors=FALSE,
          V1 = c("B & B CHRISTIAN HEALTHCARE", "BYRON HEALTH CENTER",
                 "EVANSVILLE PROTESTANT HOME",
                 "GREEN HOUSE COTTAGES OF CARMEL", "HEALTHWIN", "HERITAGE CENTER",
                 "HOLY CROSS VILLAGE AT NOTRE DAME 200325990", "HUBBARD HILL ESTATES, INC.",
                 "MAPLE MANOR CHRISTIAN HOME, INC. 100267610", "MIDDLETOWN NURSING AND",
                 "NURSING CARE AT HARTSFIELD", "SIMMONS LOVING CARE HEALTH",
                 "SKILLED CARING CTR. OF MEMORIAL", "ST. AUGUSTINE HOME FOR THE AGED",
                 "ST. PAUL HERMITAGE, LLC", "WESTMINSTER VILLAGE - WEST",
                 "ADAMS HERITAGE", "ADAMS WOODCREST", "CAROLETON MANOR",
                 "CATHEDRAL HEALTH CARE CENTER", "CHESTERTON MANOR", "CHRISTIAN CARE RETIREMENT",
                 "CLOVERLEAF OF KNIGHTSVILLE", "COLONIAL NURSING HOME",
                 "COURTYARD HEALTHCARE CENTER", "DECATUR TOWNSHIP CENTER",
                 "GOLDEN YEARS HOMESTEAD INC", "KENDALLVILLE MANOR", "LINCOLN HILLS OF NEW ALBANY",
                 "LUTHERAN LIFE VILLAGES", "LUTHERAN LIFE VILLAGES",
                 "LUTHERAN LIFE VILLAGES", "MADISON HEALTH CARE CENTER", "NEW HAVEN CENTER"),
          V6 = c(200262860, 100273280, 201272600, 201362150, 100288820,
                 100290960, 200325990, 200823940, 100267610, 100289600,
                 200229550, 100275220, 100284870, 100288920, 100274990, 201271750,
                 200289420, 100290130, 100266550, 100289030, 100267000, 100267760,
                 100467820, 100290370, 100290080, 100266850, 100287520, 100267140,
                 100286130, 100275010, 100275020, 201131260, 200983560,
                 100266640),
          V7 = c("No Chain", "No Chain", "No Chain", "No Chain", "No Chain",
                 "No Chain", "No Chain", "No Chain", "No Chain", "No Chain",
                 "No Chain", "No Chain", "No Chain", "No Chain", "No Chain",
                 "No Chain", "ADAMS", "ADAMS", "ADAMS", "ADAMS", "ADAMS", "ADAMS",
                 "ADAMS", "ADAMS", "ADAMS", "ADAMS", "ADAMS", "ADAMS", "ADAMS",
                 "ADAMS", "ADAMS", "ADAMS", "ADAMS", "ADAMS"),
          V8 = c("4/1/18", "4/1/18", "7/1/18", "7/1/18", "7/1/18", "7/1/18",
                 "7/1/18", "7/1/18", "7/1/18", "7/1/18", "7/1/18", "4/1/18",
                 "7/1/18", "7/1/18", "7/1/18", "7/1/18", "7/1/18", "7/1/18",
                 "4/1/18", "4/1/18", "4/1/18", "7/1/18", "4/1/18", "4/1/18", "7/1/18",
                 "4/1/18", "4/1/18", "4/1/18", "7/1/18", "7/1/18", "7/1/18",
                 "7/1/18", "4/1/18", "4/1/18"),
          V9 = c(112.3, 163.04, 186.72, 183.04, 187.57, 216.76, 184.48, 161.69,
                 195.33, 174.79, 193.96, 121.08, 277.55, 187.64, 211.48,
                 173.62, 215.11, 193.64, 172.57, 178.6, 158.32, 191.47, 178.46, 175.07,
                 196, 168.48, 196.42, 186.57, 189.39, 189.02, 196.48, 189.54,
                 181.84, 164.32))

Created on 2019-06-25 by the reprex package (v0.3.0)

I would love to help, but I am still unsure what you are trying to achieve. You said you want to make a graph; however, in the few details you provided I am not really sure what kind of graph you would like to make. Would you be a bit more detailed in your request? Thank you very much.

1 Like

I would like to make a dotplot that once the user selects one names it will show how it compares to the low median mean and high

so if the user selects say byron health center it will show the value given for v9 for byron health center then it will show also the average median high and low values given through the functions V9Min <- min(NewRAO$V9) V9Max <- max(NewRAO$V9) so on and so forth.