Skip to content

Commit 2cdd8bc

Browse files
Damonamajorjeancochranewrridgeway
authored
Add med_ratio_met function
* Add med_ratio_met * Update to v4 * Update R/formulas.R Co-authored-by: Jean Cochrane <[email protected]> * Remove returns * Update artifacts * Test median_met function * update docs * lintr * typo * Better Roxygen note * update all github actions * revert github changes * remove cache from gitignore * Checkout v4 * Update upload-pages-artifact version * update vignette * update median ratio in vignette * Update R/formulas.R Co-authored-by: Jean Cochrane <[email protected]> * Update docs --------- Co-authored-by: Jean Cochrane <[email protected]> Co-authored-by: Sweaty Handshake <[email protected]>
1 parent 82b3cca commit 2cdd8bc

File tree

12 files changed

+58
-14
lines changed

12 files changed

+58
-14
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
R_KEEP_PKG_SOURCE: yes
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626

2727
- name: Setup pandoc
2828
uses: r-lib/actions/setup-pandoc@v2

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: Setup R
1616
uses: r-lib/actions/setup-r@v2

.github/workflows/pkgdown.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616

1717
- name: Setup pandoc
1818
uses: r-lib/actions/setup-pandoc@v2
@@ -36,7 +36,7 @@ jobs:
3636
uses: actions/configure-pages@v3
3737

3838
- name: Upload artifact
39-
uses: actions/upload-pages-artifact@v1
39+
uses: actions/upload-pages-artifact@v3
4040
with:
4141
path: 'docs'
4242

.github/workflows/test-coverage.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: Setup R
1616
uses: r-lib/actions/setup-r@v2
@@ -41,7 +41,7 @@ jobs:
4141

4242
- name: Upload test results
4343
if: failure()
44-
uses: actions/upload-artifact@v3
44+
uses: actions/upload-artifact@v4
4545
with:
4646
name: coverage-test-failures
4747
path: ${{ runner.temp }}/package

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Encoding: UTF-8
1919
LazyData: true
2020
Imports:
2121
stats
22-
RoxygenNote: 7.2.3
22+
RoxygenNote: 7.2.4
2323
Suggests:
2424
covr,
2525
devtools,

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export(cod_met)
77
export(detect_chasing)
88
export(is_outlier)
99
export(ki)
10+
export(med_ratio_met)
1011
export(mki)
1112
export(mki_met)
1213
export(prb)

R/formulas.R

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ calc_prb <- function(assessed, sale_price) {
119119
rhs <- log(((assessed / med_ratio) + sale_price) * 0.5) / log(2)
120120
prb_model <- stats::lm(formula = lhs ~ rhs)
121121

122-
return(prb_model)
122+
prb_model
123123
}
124124

125125

126126
# nolint start
127127
#' Calculate Coefficient of Price-Related Bias (PRB)
128128
#'
129129
#' @description PRB is an index of vertical equity that quantifies the
130-
#' relationship betweem ratios and assessed values as a percentage. In
130+
#' relationship between ratios and assessed values as a percentage. In
131131
#' concrete terms, a PRB of 0.02 indicates that, on average, ratios increase
132132
#' by 2\% whenever assessed values increase by 100 percent.
133133
#'
@@ -193,7 +193,7 @@ calc_gini <- function(assessed, sale_price) {
193193

194194
result <- list(gini_assessed = gini_assessed, gini_sale = gini_sale)
195195

196-
return(result)
196+
result
197197
}
198198

199199

@@ -319,3 +319,17 @@ prb_met <- function(x) x >= -0.05 & x <= 0.05
319319
#' @inheritParams cod_met
320320
#' @export
321321
mki_met <- function(x) x >= 0.95 & x <= 1.05
322+
323+
##### Median_ratio_met #####
324+
325+
#' Check if Sales Ratio Meets IAAO Standards
326+
#'
327+
#' This function checks whether the input sales ratio falls within
328+
#' the IAAO standard range (0.9 to 1.1).
329+
#'
330+
#' @param x Numeric vector of sales ratios. The function does not calculate any
331+
#' medians, and instead assumes that vector elements already represent
332+
#' median ratios.
333+
#' @return Logical vector indicating whether each value meets the standard.
334+
#' @export
335+
med_ratio_met <- function(x) x >= 0.9 & x <= 1.1

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ index_na <- function(...) {
2525
# Merge lists into single index where if one list has NA, idx value is TRUE
2626
idx <- as.logical(Reduce("+", lapply(list(...), is.na)))
2727

28-
return(idx)
28+
idx
2929
}

_pkgdown.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ reference:
6060
- boot_ci
6161
- detect_chasing
6262
- is_outlier
63+
- med_ratio_met
6364

6465
- title: Data
6566
desc: Sample data used for testing and demonstrations

man/med_ratio_met.Rd

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)