Well hello, and welcome to my github!
geoscanning's Introduction
geoscanning's People
geoscanning's Issues
potential intakeRetailers syntax error
Running this line of code appears to work, leading to a retailers object with 32079 observations and 11 variables:
retailers <- intakeRetailers("~/Box Sync/GeoScanning_Data_822815/Data/dataOutputs/all_Retailers_10_20_20.csv")
But it also generates this error message:
Note: Using an external vector in selections is ambiguous.
โน Use all_of(canonical_names)
instead of canonical_names
to silence this message.
โน See https://tidyselect.r-lib.org/reference/faq-external-vector.html.
This message is displayed once per session.
possible need for ungroup somewhere in the bufferAndJoin function
Running this code fails:
cleanData_Retailers_Tracts <- cleanData %>%
bufferAndJoin(retailers, ., 2272, 100)
It results in this expected output:
[1] "Retailer data contain"
[1] 0
[1] "invalid shapes"
But it also ends with this error message:
Error in UseMethod("st_join") :
no applicable method for 'st_join' applied to an object of class "c('grouped_df', 'tbl_df', 'tbl', 'data.frame')"
Note that running intakeRetailers in the preceding step reveals that there are 25 NA geodata observations, which may be causing an error downstream in bufferAndJoin. There are no NA geometries in the main geolocation dataframe (i.e., cleanData).
Leaflet
I'm trying out the Leaflet function in the R Markdown file I have going for the pilot data analyses, but it has really messed things up ever since I attempted to run it. If I try to open that script now, RStudio freezes and becomes completely blank. This is the case even though I have restarted my computer.
I'm not 100% sure what is going on, but I wonder if part of the problem is that I have so much data? I'll try the sample function to narrow down the number of data points once I'm able to retrieve my RMarkdown script, but I'm curious if you have any other ideas, @mafichman.
Possible issue with get_acs() relying on a deprecated funs() function
I can successfully run this block of code:
state_tracts <-
get_acs(geography = "tract",
variables = myACS_Vars,
year = 2017,
state = fips(unique(substr(cleanData_Retailers_Tracts$GEOID, 1, 2)), to = "Abbreviation"),
geometry = TRUE,
output = "wide") %>%
rename(gini_est = B19083_001E,
gini_err = B19083_001M,
medinc_est = B19013_001E,
medinc_err = B19013_001M,
pop_est = B01003_001E,
pop_err = B01003_001M,
popb_est = B02001_003E,
popb_err = B02001_003M,
popw_est = B02001_002E,
popw_err = B02001_002M,
povtot_est = B17026_001E,
povtot_err = B17026_001M,
pov1_est = B17026_002E,
pov1_err = B17026_002M,
pov2_est = B17026_003E,
pov2_err = B17026_003M,
pov3_est = B17026_004E,
pov3_err = B17026_004M,
edutot_est = B15003_001E,
edutot_err = B15003_001M,
edu4year_est = B15003_022E,
edu4year_err = B15003_022M) %>%
mutate(pct_black = popb_est/pop_est,
pct_white = popw_est/pop_est,
below_pov = (pov1_est+pov2_est+pov3_est)/povtot_est,
pct_4yd = edu4year_est/edutot_est) %>%
st_transform(crs = 4326)
However, I get this error message:
This suggests that one of the functions it's relying on is a deprecated function. I'm not sure which it is. I suspect it's get_acs(). If so, there's not much we can do about that, but I haven't had time to fully troubleshoot this.
I could use a primer on the new cleanDates function
@bmattan when we meet you can update me on how the additions to cleanDates and removeDuplicates should be functioning - I think the simple_codebase.R needs some updates as well as the code vignettes in the .R files themselves.
writing out shape files fails
Writing out shape files doesn't seem to work.
st_write(cleanData, "/Volumes/cnlab/GeoScan/Pilot_Analyses/Shapefiles/processed_emageo_112420.shp")
There are no NAs in cleanData geometries, but there may be NAs or forbidden characters for data within columns. Could that be causing the issue?
bind_rows error in joinTracts
@mafichman, your intuition was right that there was a state identified as NA in the myStates object in the joinTracts function. I added an na.omit() argument to the piped code creating myStates (see line 42). However, joinTracts had another error later on that I wasn't able to quickly figure out. The error message suggests that bind_rows needs a dataframe or a named atomic vector. As the code is currently written, bind_rows is receiving a "large list" object.
Here's the bind_rows error message:
Here is what stateTracts looks like up to bind_rows (as of line 48):
Possible issue with st_join() when joining census data to sf dataframe that already has GEOIDs from joinTracts(). Use merge() instead?
I run this block of code.
cleanData_join_census <- st_join(cleanData_Retailers_Tracts %>%
st_transform(crs = 4326),
state_tracts %>%
#removed GEOID from the select function because spatial join ends up creating GEOID.x and GEOID.y
dplyr::select(NAME, gini_est, medinc_est, pct_black, pct_white, below_pov, pct_4yd) %>%
st_transform(crs = 4326),
join = st_intersects,
left = TRUE)
This results in 5 observations in Delaware that crop up as NAs in the output of cleanData_join_census, but they are actually present in state_tracts. Should this just be a tabular join using merge() rather than a spatial join using st_join()?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.