Open jholwegn opened 3 years ago
Logical statements are a little tricky.
Compound logical statements need to be combinations of two logical vectors.
You currently have a numeric vector and a logical vector in your statement.
downtown$amtdelinqt & downtown$landuse == "Commercial"
Which is probably why you are getting a nonsensical answer.
First define a group for tax delinquent properties then use that in your compound logical statement.
@jholwegn how are we on this? Good?
@jamisoncrawford Good evening! I have been mulling over this question all day. I am confused on what my second logical statement should be in order to create a logical vector. I have the same code as mentioned above. Thanks!
@jholwegn one approach is to create a subset (smaller dataset) from downtown
that contains only commercial properties. We can call it dt_coms
:
dt_coms <- downtown[downtown$landuse == "Commercial", ]
Now you have a subset of only commercial properties: dt_coms
. What can you do with this subset to get to the right answer?
@Julia-Hernandez how would you operationalize "is delinquent" (true/false logical vector) from a numeric variable like amount of back-taxes owed?
downtown$amtdelinqt
What types of values do you see in the vector?
summary( downtown$amtdelinqt )
I'm confused about Question 7 Part 2.
I was able to figure out the code to generate the Tax Delinquent Non-Commercial Properties map shown in the instructions, but I don't understand how it relates to the question.
If the Tax Delinquent Non-Commercial Properties map isn't related, I would like to know if I'm on the right track with this code:
result <- downtown$amtdelinqt & downtown$landuse == "Commercial"
mean(result/downtown$amtdelinqt, na.rm = T)
Thank you!