DS4PS / cpp-526-fall-2020

Course shell for CPP 526 Foundations of Data Science I for Fall 2020
http://ds4ps.org/cpp-526-fall-2020/
MIT License
3 stars 1 forks source link

Lab-01-Q5 & Q6 #31

Open AhmedRashwanASU opened 3 years ago

AhmedRashwanASU commented 3 years ago

@jamisoncrawford I'm not sure if I understood this correctly, are below codes are the final solution for the below questions?

5- Which neighborhood contains the most tax parcels? table() with the neighborhood variable


# Pass the appropriate variable to function 'table()'

x<-table(dat$neighborhood)
print(x)

# Optional: Use additional functions to narrow your results

max(x) 

## [1] 4889
  1. Which neighborhood contains the most vacant LOTS? table() with the neighborhood and land_use variables


# Pass two variables to function 'table()', separated by a comma

x<-table(dat$neighborhood , dat$land_use=="Vacant Land")
print(x)

# (Optional) use additional functions to narrow your results

max(x)