cssearcy / AYS-R-Coding-SPR-2020

Coding in R for Policy Analytics
https://cssearcy.github.io/AYS-R-Coding-SPR-2020/
3 stars 3 forks source link

Lab 2 - Challenge Question 1 #12

Open SalvadorW2 opened 4 years ago

SalvadorW2 commented 4 years ago

I've done the standard calculation for determining value per land area: total value / total area. Then, I've made a variable for value per acre greater than 1,000,000.

valperacre <- ( downtown$assessedval / downtown$acres )
milperacre <- ( valperacre > 1000000 )

However, when I then plug "milperacre" into the map formula, the map I get contains far more red area than the one in the lab instructions.

these <- milperacre                                       # define your group
group.colors <- ifelse( these, "firebrick", "gray80" )    # don't change this
plot( downtown,  border="gray70", col=group.colors )      # don't change this

Am I going about this the wrong way?

lecy commented 4 years ago

The question asks about assessed LAND value, not assessed value. The variable names need to be updated in the data dictionary but you can see the two definitions here:

https://ds4ps.org/Data-Science-Class/DATA/syr_parcels.html

Try:

value.acre <- downtown$assessedland / downtown$acres
lecy commented 4 years ago

Note the format for code highlighting on GitHub. Put fences around code:

```r
valperacre <- ( downtown$assessedval / downtown$acres )
milperacre <- ( valperacre > 1000000 )

To get: 

```r
valperacre <- ( downtown$assessedval / downtown$acres )
milperacre <- ( valperacre > 1000000 )
jamisoncrawford commented 4 years ago

Ah, thank you @lecy for that!

jamisoncrawford commented 4 years ago

Edit: Deleted my original post as not to mislead - thanks again, @lecy!