Open lghb2005 opened 2 years ago
Hi professor @AntJam-Howell , in case you miss my post above. Could you please take a look at my question above? Many thanks~
@lghb2005 I believe the problem is likely some of the variables in temp.names may not have been loaded in or renamed properly. From our previous labs, you can try something like this:
these.variables <- c("pnhwht12", "pnhblk12", "phisp12", "pntv12", "pfb12", "polang12",
"phs12", "pcol12", "punemp12", "pflabf12", "pprof12", "pmanuf12",
"pvet12", "psemp12", "hinc12", "incpc12", "ppov12", "pown12",
"pvac12", "pmulti12", "mrent12", "mhmval12", "p30old12", "p10yrs12",
"p18und12", "p60up12", "p75up12", "pmar12", "pwds12", "pfhh12")
names(these.variables) <- c( "White", "Black", "Hispanic", "Native America", "Foriegn", "Other Language", "HS Degree", "College Degree", "Unemployed", "Female Workforce", "Professionals", "Manufacturers", "Veterans", "Self Employed", "Household Income", "Income per Capita", "Poverty", "Owner-Occupied Units", "Vacant Units", "Multifamily Units", "Median Rent", "Median House Value", "Structures > 30yrs", "HH < 10yrs", "17 and Under", "60 and Up", "75 and Up", "Married", "Widowed, Divorced, Separated", "Families with Children" )
radioButtons( inputId="demographics",
label = h3("Census Variables"),
choices = these.variables,
#choiceNames=temp.names,
#choiceValues=these.variables,
selected="pnhwht12")
The examples that you show relate mainly to different approaches to renaming variables and indexing dataframes. You can play around with the examples in a separate .R document to see the mechanics of how each line of code is working.
Thanks a lot for your suggestions@AntJam-Howell ~ I will look into that and play those codes around!
Hi professor Howell,
I hope you are doing well! I have got an issue with adding interpretable variable names in building the dashboard. I tried to enable and run the
choices = temp.names
for demographics, chunk 3 in the template. However, when I rendered the dashboard, no choropleth maps showed up but reported errors "cannot find the variables selected."While figuring out this issue, could you please explain a bit about the following codes included in the template? I guess I would need to understand those lines better to do things properly.
Much appreciated in advance, and I wish you a wonderful weekend!
Best, Robin