DS4PS / cpp-526-spr-2020

Course shell for CPP 526 Foundations of Data Science I for Spring 2020.
http://ds4ps.org/cpp-526-spr-2020/
3 stars 0 forks source link

Lab 2: Single Family Home #12

Closed babsr closed 4 years ago

babsr commented 4 years ago

I'm trying to do the question, "How many Single Family homes are in Syracuse? Map your results." I have followed the code that is on the lab instructions. When I run the code it is printing out Warning messages.

Here is my code: `singleFamily <- dat$land_use == "Single Family"

sum(singleFamily)

group.colors <- ifelse( singleFamily, "firebrick", "gray80") plot( dat, border=NA, col=group.colors, main= 'land_use == "Single Family"', cex.main=2.5) ` The errors that I am receiving are as follows:

image

babsr commented 4 years ago

Saw that this wasn't needed.

lecy commented 4 years ago

Yes, please skip that example please. Start with the downtown data.

Note that you need the spatial map packages loaded before you can plot the data:

library( geojsonio )
library( sp )
library( rgdal )

Load the map file:

URL <- "https://raw.githubusercontent.com/DS4PS/Data-Science-Class/master/DATA/downtown-syr.geojson"
downtown <- geojson_read( URL, what="sp" )
plot( downtown,  border="gray50", col="gray80" )
jamisoncrawford commented 4 years ago

@babsr one more little potential pitfall - the variable name in the .geojson data is landuse while the variable name in the parcel data is land_use!

lecy commented 4 years ago

just fixed that in q1 instructions! thanks for the catch

jamisoncrawford commented 4 years ago

@lecy sure thing!