Open ecking opened 4 years ago
@ecking can you attach your .rmd file for me to take a look.
@ecking Just went through and figured out that the problem actually takes place on line 149 of you .RMD file when you merge the 2 datasets together
msp <- merge( msp.pop, census.dat, by.x="GEOID", by.y="tractid" )
For some reason, the merge brings back an empty dataset despite the tractid and GEOID number matching.
When I converted the matching variable in each dataset to be numeric instead of character, and merged, the problem was solved. You can convert the variables to numeric as shown below, and then re-run the merge after.
census.dat$tractid<-as.numeric(census.dat$tractid)
msp.pop$GEOID<-as.numeric(msp.pop$GEOID)
Thanks @Anthony-Howell-PhD, I never would have gotten that...
I'm running the code now and I hit the last section of code under Identifying "Neighborhood Clusters" -- Build the charts to compare census characteristics across the groups. and there is an a reference to object data.dictionary here that is not being found.
How should I go about resolving that? I do see that there is code at the bottom of the page for data.dictionary but seems out of order.
looks like adding that chunk of code before that last chunk worked.
Thanks
I know, second question of the night. But what does "Error in st_cast_sfc_default(x) : list item(s) not of class sfg" mean?
When I put in
msp.sp <- as_Spatial( msp )
I get this message. I'm googling it and trying out different things. But even the help documentation I'm not quite understanding.