Public-Health-Scotland / phsmethods

An R package to standardise methods used in Public Health Scotland (https://public-health-scotland.github.io/phsmethods/)
https://public-health-scotland.github.io/phsmethods/
54 stars 13 forks source link

Jack #19

Closed jackhannah95 closed 4 years ago

jackhannah95 commented 4 years ago

Most of these changes are spacing and typos. The main change (and the one justifying updating to version 0.1.1) is changing any test along the lines

if (class(x != "y")) error to

if(!inherits(x, "y")) error

so as to better deal with situations like this:

data(airquality); class(tibble::as_tibble(airquality))
#> [1] "tbl_df"     "tbl"        "data.frame"

class(tibble::as_tibble(airquality)) == "tbl"
#> [1] FALSE  TRUE FALSE

inherits(tibble::as_tibble(airquality), "tbl")
#> [1] TRUE

Let me know if you spot any more typos and I'll do another release once it's been merged.