Title: | A Collection of Nifty Functions and Objects for OJO Analysts |
---|---|
Description: | We find ourselves repeating the same simple tasks or running a series of R commands over and over again. No more! |
Authors: | Brancen Gregory [aut, cre], Andrew Bell [aut] |
Maintainer: | Brancen Gregory <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.3 |
Built: | 2024-11-22 02:50:09 UTC |
Source: | https://github.com/openjusticeok/ojoutils |
Takes a path and determines whether it is empty.
dir_empty(path)
dir_empty(path)
path |
A relative or absolute path to the directory to test. |
TRUE
if the directory is empty, otherwise FALSE
.
If the directory doesn't exist, or the string supplied to path
isn't
recognized as a valid path, then the function returns an error.
A thin wrapper around head
to sooth the pain of context switching between R and SQL
limit(x, ...)
limit(x, ...)
x |
The object to limit |
... |
Additional arguments to |
A thin wrapper around head
that allows
limit
to be used in place of head
. This is useful because
sometimes it is hard to context switch between R and SQL. It can be used on lazy data frames since
this package imports dbplyr
.
The limited object
Oklahoma Counties
ojo_counties
ojo_counties
An object of class character
of length 77.
Parse Oklahoma Counties
ojo_parse_county( county, ..., case = "lower", squish = NULL, suffix = NULL, counties = ojo_counties, .silent = FALSE )
ojo_parse_county( county, ..., case = "lower", squish = NULL, suffix = NULL, counties = ojo_counties, .silent = FALSE )
county |
A string or character vector that represents an Oklahoma county |
... |
Placeholder for future arguments |
case |
The case to format the county string to. One of "lower", "upper", or "title". |
squish |
A boolean indicator of whether to remove whitespace |
suffix |
Specification of a suffix to remove from each item in |
counties |
A vector of valid county names to match on. |
.silent |
A currently unused argument. |
Wrapper for quarto use template
command. Defaults to OJO html template.
ojo_use_template(path, template = "openjusticeok/ojo-report-template")
ojo_use_template(path, template = "openjusticeok/ojo-report-template")
path |
The name of the directory where the template should be added. This should be a string representing an absolute path, or a path relative to the current working directory. |
template |
The name of the Quarto template to use. This should be a string in the format "username/repository". Default is "openjusticeok/ojo-report-template". |
This function does not return a value. If the user chooses not to proceed with the operation, the function exits silently.
## Not run: ojo_use_template(template = "openjusticeok/ojo-report-template", path = "my_directory") ## End(Not run)
## Not run: ojo_use_template(template = "openjusticeok/ojo-report-template", path = "my_directory") ## End(Not run)