DS4PS / cpp-526-fall-2019

Course material for CPP 526 Foundations of Data Science I
http://ds4ps.org/cpp-526-fall-2019
4 stars 4 forks source link

Explainer Assignment #23

Open Jigarci3 opened 5 years ago

Jigarci3 commented 5 years ago

Hello, Is there a set due date for the explainer assignment listed on the syllabus? Should this assignment be posted on YellowDig?

Thanks!

etbartell commented 5 years ago

I remember him saying it would be due at the end of the course. He said last week that he would be posting it sometime this week. But yeah, hopefully we get a little more guidance on that soon. I still have no idea what my topic for that will be.

lecy commented 5 years ago

It is posted!

https://ds4ps.org/cpp-526-fall-2019/LABS/code-through-assignment.html

lecy commented 5 years ago

Key instructions here:

For this assignment your code-through should be short and simple. It can be as short as two printed pages

Jigarci3 commented 5 years ago

Hello @ etbartell

Yes, Dr. Lecy said he would be posting it last night- it is up on our course schedule under “Code-Through Assignment.”

From: etbartell notifications@github.com Sent: Thursday, October 3, 2019 11:46 AM To: DS4PS/cpp-526-fall-2019 cpp-526-fall-2019@noreply.github.com Cc: Joanna Garcia Arellano jigarci3@asu.edu; Author author@noreply.github.com Subject: Re: [DS4PS/cpp-526-fall-2019] Explainer Assignment (#23)

I remember him saying it would be due at the end of the course. He said last week that he would be posting it sometime this week. But yeah, hopefully we get a little more guidance on that soon. I still have no idea what my topic for that will be.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_DS4PS_cpp-2D526-2Dfall-2D2019_issues_23-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAM7IJFBRUEUI7TAX5DXXRGLQMY4UZA5CNFSM4I4DC6FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAJF7JQ-23issuecomment-2D538075046&d=DwMCaQ&c=l45AxH-kUV29SRQusp9vYR0n1GycN4_2jInuKy6zbqQ&r=2_gsW5r69wL0UlLE_w1XjVkYdTglpAz3JrcaTly0IDo&m=xTj4scq-Ev6s2bQVT4c1ON7gXT6IJXb_0AnlH4T3fWg&s=6lS-WrNxaxVawnVropjwsDj2MdzTQgL33mqQGHJVfdA&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AM7IJFBLC7LXV4IYRX4CXUTQMY4UZANCNFSM4I4DC6FA&d=DwMCaQ&c=l45AxH-kUV29SRQusp9vYR0n1GycN4_2jInuKy6zbqQ&r=2_gsW5r69wL0UlLE_w1XjVkYdTglpAz3JrcaTly0IDo&m=xTj4scq-Ev6s2bQVT4c1ON7gXT6IJXb_0AnlH4T3fWg&s=O7GLST8cgoQQCkL0tnI8KXxy2Wdv8oPEvPpvmY_eETA&e=.

castower commented 5 years ago

Hello all,

Does anyone know if it's okay if we use shiny for the code-through assignment? Or is that too complicated and we should stick to just a basic rmd?

Thanks!

lecy commented 5 years ago

My advice is usually to keep it simple and layer on complexity as you go. But I also encourage your to challenge yourself.

The one caveat is you can't share an shiny HTML file directly, you would have to upload it to shinyapp.io like your dashboard and share the link to that on YellowDig. You would submit your RMD file and that link then.

castower commented 5 years ago

My advice is usually to keep it simple and layer on complexity as you go. But I also encourage your to challenge yourself.

The one caveat is you can't share an shiny HTML file directly, you would have to upload it to shinyapp.io like your dashboard and share the link to that on YellowDig. You would submit your RMD file and that link then.

@lecy I decided to try to utilize shiny, but I'm a bit confused on what I'm doing wrong. My selection tab works fine, but it doesn't produce a plot. Here's is my code:


library(shiny)

inputPanel(
  selectInput("category", label = "Select Category:",
              choices = c("Age", 
                          "Location" = "Area",
                          "Level of Education" = "College",
                          "Continent",
                          "Gender",
                          "Homelessness" = "Housing",
                          "Internet Access" = "Internet",
                          "First Language" = "Language (first)",
                          "Literacy Level" = "Literacy",
                          "Nutrition",
                          "Cell Phone Access" = "Phones",
                          "Poverty",
                          "Religion",
                          "Water Access" = "Water"), 
              selected = "Religion")

)

renderPlot({

InteractiveWaffle <- 
  People %>% 
  filter( Category %in% input$category )

ggplot(InteractiveWaffle, aes(fill = Subcategory, values = Value)) +
  geom_waffle(color = "white", size=1.125, n_rows= 5) +
  facet_wrap(~Category, ncol=1,) +
  scale_x_discrete(expand=c(0,0)) +
  scale_y_discrete(expand=c(0,0)) +
  ggthemes::scale_fill_tableau(name=NULL) +
  coord_equal() +
  labs(
    title = "If The World Was 100 People"
  ) +
  theme_ipsum_rc(grid="") +
  theme_enhance_waffle()  

})
castower commented 5 years ago

Also, here is the code for my static waffle. It works fine:


library(hrbrthemes)
library(waffle)
library(tidyverse)

ggplot(ContData, aes(fill = Subcategory, values = ContData$Value)) +
  geom_waffle(color = "white", size=1.125, n_rows= 5) +
  facet_wrap(~Category, ncol=1,) +
  scale_x_discrete(expand=c(0,0)) +
  scale_y_discrete(expand=c(0,0)) +
  ggthemes::scale_fill_tableau(name=NULL) +
  coord_equal() +
  labs(
    title = "If The World Was 100 People"
  ) +
  theme_ipsum_rc(grid="") +
  theme_enhance_waffle()
lecy commented 5 years ago

What is ContData? There is no data source listed here.

lecy commented 5 years ago

@castower Are these columns? Should this be select() instead of filter()? I have no idea what your data looks like.

InteractiveWaffle <- 
  People %>% 
  filter( Category %in% input$category )
lecy commented 5 years ago

To preview the data on a discussion board try:

dput( head( People ) ) %>% pander()

It should return markdown code that you can paste here.

castower commented 5 years ago

@lecy

I removed the inputPanel() function and restarted RStudio and it has started working!

Here is the output of the data, for reference though in case it may be helpful to anyone else:

-----------------------------------
 Category     Subcategory    Value 
----------- --------------- -------
 Continent       Asia         60   

 Continent      Africa        16   

 Continent   South America     9   

 Continent   North America     5   

 Continent      Europe        10   

  Gender        Female        50   
-----------------------------------