Watts-College / paf-515-template

https://watts-college.github.io/paf-515-template/
1 stars 1 forks source link

Lab 1 - Division Population #2

Open ioxoiperez27 opened 1 month ago

ioxoiperez27 commented 1 month ago

Screenshot (3)

Im having an issue with getting my data to load in the final part of my code. Does anyone have any suggestions?

castower commented 1 month ago

Hello @ioxoiperez27, There may be an issue with your earlier table.

What is the output of acs_pull?

How is your census_division variable formatted?

ioxoiperez27 commented 1 month ago

Screenshot (4) The table didnt give me an issue unless there is something I missed. Ive included a screenshot

ioxoiperez27 commented 1 month ago

I was able to save my API password and load it, the project_data_steps file also loaded correctly with my choice in "South Atlantic Division".

castower commented 1 month ago

@ioxoiperez27

Thanks! This is the census_variable table.

What does the output for acs_pull look like?

Since you're left joining to that table it appears that's where the issue is.

ioxoiperez27 commented 1 month ago

# Query Census API via tidyverse
acs_pull <- get_acs(geography = "division", 
              variables = c("S0101_C01_001", "S0101_C03_001", "S0101_C05_001"), 
              year = 2020) %>% filter(NAME == census_division)
castower commented 1 month ago

@ioxoiperez27 You can print the data by typing acs_pull or you can use dput(acs_pull)

ioxoiperez27 commented 1 month ago

@castower , okay i see, there is no data. It says 0 rows

castower commented 1 month ago

@ioxoiperez27 Okay, that's why you're getting 0 rows in your last table.

Do you get an error message when you rerun the query to create that table?

castower commented 1 month ago

Ah, I see it now in your screenshot. There's an extra space in your census division:

"South Atlantic Division "

Should be:

"South Atlantic Division"

You can update that in your project_data_steps.R file, clear your environment, and rerun everything and you should get your expected output.

@ioxoiperez27

ioxoiperez27 commented 1 month ago

I JUST noticed that too!

ioxoiperez27 commented 1 month ago

Okay thank you, it was driving me crazy. :)

castower commented 1 month ago

It's almost always something so small! 😀 glad you caught it! @ioxoiperez27