## Warning: package 'dplyr' was built under R version 3.6.2
## ## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats': ## ## filter, lag
## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union
library(rio) #devtools::install_github("smach/rmiscutils") library(lubridate)
## ## Attaching package: 'lubridate'
## The following object is masked from 'package:base': ## ## date
## Warning: package 'scales' was built under R version 3.6.2
This is downloaded from the County Auditor and Recorder's Data. This can be any spreadsheet of county data as long as it has the parcel number, mortgage amount, tax district, effective rate, owner name, date of mortgage, and (Auditor's) market value.
This is just for commerical properties with land use codes >199 and <500.Exempt properties are not included.
#importing data Commercial_Properties <- rio::import("Franklin County Combined Data.csv") #OR each County
What is the amount owed to each county?
note: in theory we would just add all the taxes_paid and there's always going to be a certain percentage of people behind on their taxes, and we're not interested in that. So here we are calculating the total amount to taxes collected in theory
Commercial_Properties <- mutate(Commercial_Properties, Amount_Owed_to_County=market_value*`Effective Rate`*.35*.001)
How much does each district raise?
## `summarise()` ungrouping output (override with `.groups` argument)
How much is that altogether?
##  1051053753
That same number, but written as currency with commas so you can read:
First, our data is in the wrong format. When the date, owner, and amount are the same, the sale amount is actually for ALL the properties together. But there are different parcel numbers because large properties are usually composed of several parcels next to each other.
So for example, parcels 123, 456, and 789 are are listed as sold to Company LLC on June 22, 2019 for 6 million dollars. But each is not worth 6 million. They are worth 1, million, 2 million, and 3 million dollars respectively. All the properties together are worth valued at 6 million dollars, BUT the mortgage amount field on each reads 6 million dollars. And we don't want to accidentally log it as 18 million dollars.
So here we will group by owner, date of mortgage, and the mortgage amount. But then we run into another problem: Some of these have multiple tax districts:
Looking_For_Sort_of_dupulicates <- Commercial_Properties %>% group_by(owner,date_of_mortgage,mortgage_amount) %>% count(tax_district) datatable(Looking_For_Sort_of_dupulicates)
## Warning in instance$preRenderHook(instance): It seems your data is too ## big for client-side DataTables. You may consider server-side processing: ## https://rstudio.github.io/DT/server.html