DS4PS / cpp-526-spr-2020

Course shell for CPP 526 Foundations of Data Science I for Spring 2020.
http://ds4ps.org/cpp-526-spr-2020/
3 stars 0 forks source link

Final Project - Valuebox #37

Closed ecking closed 4 years ago

ecking commented 4 years ago

Hi there,... again!

I'm confused as to why my "renderVenderBox" is not filtering down when the user selects the street name.

select input id is street. I can't figure out what I'm doing wrong since it looks the same as to what is happening on the second tab. I copied and pasted and modified it slightly but the main thing that is different is input$Street.

Any ideas?
renderValueBox({ d3 <- dat1%>% filter(StreetName %in% input$Street)

total.fatalities <- sum( dat1$Totalfatalities ) valueBox( total.fatalities, icon = "fa-briefcase-medical", color = ifelse(total.fatalities > 10, "danger", "primary")) })`

jamisoncrawford commented 4 years ago

Hi! It looks like you're assigning your filtered data to object d3:

d3 <-
dat1%>%
filter(StreetName %in% input$Street)

But then you're calling sum() with object dat1:

total.fatalities <- sum( dat1$Totalfatalities )

Could that be it?

ecking commented 4 years ago

so I tried everything but "d3." I think I kept writing dat3. :(

That moment when you think you're a detail oriented person and then you're in a class where you code... smh

jamisoncrawford commented 4 years ago

Haha, it happens to the best of us!