Watts-College / cpp-529-spr-2022

https://watts-college.github.io/cpp-529-spr-2022/
0 stars 2 forks source link

Final Project Issue #21

Closed jmacost5 closed 2 years ago

jmacost5 commented 2 years ago

tracts(state = "UT", county = "Salt Lake", cb = TRUE, year = 2017)

JasonSills commented 2 years ago

Hi @jmacost5,

It looks like challenges with the project in general, rather than specific lines of code. I suggest continuing to work on it and watching or joining the lab sessions focusing on the project. Also, this board's ability to answer questions is maximized when specific errors are called out. For the "Get Help" board it is best to come in with specific challenges and specific questions and the errors that are returned.

jmacost5 commented 2 years ago

I think the first issue that I am having though is that I am getting an error Error in tracts(state = "UT", county = "Salt Lake", cb = TRUE, year = 2017) : could not find function "tracts" Is this an issue with me not loading the packages or the order?

JasonSills commented 2 years ago

Generally you will need to include the specific line of code returning this error. This type of error indicates that you don't have the packages loaded. Double check that the packages are installed and loaded.

jmacost5 commented 2 years ago

Ok I figured that issue out but now I cannot run the save cartogram, slc <- spTransform( slc, CRS("+init=epsg:3395")) Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘spTransform’ for signature ‘"sf", "CRS"’

jmacost5 commented 2 years ago

I had to change it to st_transform() inorder to run it...

jmacost5 commented 2 years ago

@JasonSills @u12345 I think we may have went over this yesterday's lab but it isnt posted yet so I wanted to ask this question. I am having trouble with the Choropleth Map and I am assuming it has to possibly do with the 'input$demographics'. What I am confused/wondering is that is the "x[ input$demographics ] which has to do with the information from the community demographics?

x <- dd.name
names(x) <- value
temp.names <- paste0( dd.name )
radioButtons( inputId="demographics", 
              label = h3("Census Variables"),
              # choices = these.variables, 
              choiceNames=temp.names,
              choiceValues=these.variables,
              selected="pnhwht12")
x[ input$demographics ]
JasonSills commented 2 years ago

Hi @jmacost5,

For new issues please create a new post with a new title. This will help other students with the same problem find their answers.

What type of error do you have? Is there a message with an error? Is there a gray box with no visualization? Do you have a map but the buttons are not responsive? Each error would require a very different fix.

jmacost5 commented 2 years ago

Hi @jmacost5,

For new issues please create a new post with a new title. This will help other students with the same problem find their answers.

What type of error do you have? Is there a message with an error? Is there a gray box with no visualization? Do you have a map but the buttons are not responsive? Each error would require a very different fix.

I just added it into the new issue but the error I get its

 x[ input$demographics ]
Error: object 'input' not found
JasonSills commented 2 years ago

Hi @jmacost5 ,

You don't need the line of code in your radiobuttons code chunk:

x[ input$demographics ]

This is the code used to create radio buttons: x <- dd.name

names(x) <- value

temp.names <- paste0( dd.name )

radioButtons( inputId="demographics", label = h3("Census Variables"), choiceNames=temp.names, choiceValues=these.variables, selected="pnhwht12")

And the "demographics" is referenced in the renderPlot function in this line:

get_data <- reactive({ yourdataset.sf <- yourdataset.sf %>% mutate( q = ntile( get(input$demographics), 10 ) )
})