Package 'MCOE'

Title: Creates New Folders and Loads Standard Practices for Monterey County Office of Education
Description: Basic Setup for Projects in R for Monterey County Office of Education. It contains functions often used in the analysis of education data in the county office including seeing if an item is not in a list, rounding in the manner the general public expects, including logos for districts, switching between district names and their county-district-school codes, accessing the local 'SQL' table and making thematically consistent graphs.
Authors: David Dobrowski [aut, cre, cph]
Maintainer: David Dobrowski <[email protected]>
License: MIT + file LICENSE
Version: 0.4.0
Built: 2024-11-03 04:36:28 UTC
Source: https://github.com/dobrowski/mcoe

Help Index


MCOE The inverse of _in_ where the list is excluded

Description

MCOE The inverse of _in_ where the list is excluded

Usage

x %notin% table

Arguments

x

Item or list to look at

table

List to make sure it is not part of

Value

'

Examples

fruit <- c("apple", "banana", "pear", "pineapple")
"kiwi" %notin% fruit

When using the MCOE 'SQL' tables, it will merge codebook descriptions from CDE

Description

When using the MCOE 'SQL' tables, it will merge codebook descriptions from CDE

Usage

left_join_codebook(df, tablename, field)

Arguments

df

local dataframe you want to append labels to

tablename

which 'SQL' table is the data from

field

which field in the table do you want the labels for

Value

An 'tibble' of the same type as '.data'. The output has an one column names 'definition' which contains labels for the passed argument 'field'.

Examples

try(
sbac.filtered <- tbl(con, "CAASPP") |>
 head(100) |>
 collect() |>
 left_join_codebook("CAASPP", "Subgroup_ID")
)

Graphing function to make lollipop bar graphs

Description

Graphing function to make lollipop bar graphs

Usage

lollipop(df, y_var, x_var, colorme)

Arguments

df

dataframe source to graph

y_var

variable for Y

x_var

variable for X

colorme

color to make the bars

Value

a 'ggplot' class graph with horiztontal bars with circles at the end of the bars

Examples

library(dplyr)
df.example <- dplyr::tribble(~name, ~rate, "Nina",32,"David",65)
lollipop(df = df.example, x_var = name, y_var = rate, colorme = "pink" )

Given a CDS code it provides the logo

Description

Given a CDS code it provides the logo

Usage

mcoe_logo_location(cds.number)

Arguments

cds.number

County-District-School code from California Department of Education

Value

'mcoe_logo_location' returns a 'string' containing a file location the district logo

Examples

mcoe_logo_location("27659870000000")

Given a CDS code, it gives the name of the district

Description

Given a CDS code, it gives the name of the district

Usage

mcoe_name(cds.number)

Arguments

cds.number

County-District-School code from California Department of Education

Value

a 'string' of the district name

Examples

mcoe_name("27661590000000")

Connects to the MCOE 'SQL' tables

Description

Connects to the MCOE 'SQL' tables

Usage

mcoe_sql_con()

Value

a database connection in the form of [DBI::dbConnect]

Examples

try(mcoe_sql_con())

Modifies ggplots to use a common theme

Description

Modifies ggplots to use a common theme

Usage

mcoe_theme

Format

An object of class list of length 4.

Value

a 'list' of [ggplot] elements to add to a graph

Examples

library(dplyr)
df.example <- dplyr::tribble(~name, ~rate, "Nina",32,"David",65)
g <- ggplot2::ggplot(df.example, ggplot2::aes(name, rate)) + ggplot2::geom_col()
g + mcoe_theme

School District Directory

Description

A subset of data from California Department of Education identifying schools

Usage

mry.dist

Format

## 'mry.dist' A data frame with 256 rows and 50 columns:

District

District name

School

School name

CDScode

County, District, School code

...

Source

<https://www.cde.ca.gov/ds/si/ds/pubschls.asp>


Rounding the way most people do it with .5 roudning up

Description

Rounding the way most people do it with .5 roudning up

Usage

round2(x, digits = 2)

Arguments

x

number to be rounded

digits

how many digits to round to

Value

'round2' returns a truncated 'numeric' with decimal places equal to 'digits' argument

Examples

x <- 1.2345
round2(x, digits = 2)