Type: | Package |
Title: | Creates New Folders and Loads Standard Practices for Monterey County Office of Education |
Version: | 0.4.0 |
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. |
License: | MIT + file LICENSE |
URL: | https://github.com/dobrowski/MCOE |
BugReports: | https://github.com/dobrowski/MCOE/issues |
Depends: | R (≥ 2.10) |
Imports: | DBI, dplyr, forcats, ggplot2, ggthemes, googlesheets4, keyring, magick, odbc, scales |
Suggests: | testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.2.3 |
NeedsCompilation: | no |
Packaged: | 2024-02-05 22:01:08 UTC; daviddobrowski |
Author: | David Dobrowski [aut, cre, cph] |
Maintainer: | David Dobrowski <ddobrowski@montereycoe.org> |
Repository: | CRAN |
Date/Publication: | 2024-02-06 18:00:09 UTC |
MCOE: 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.
Author(s)
Maintainer: David Dobrowski ddobrowski@montereycoe.org [copyright holder]
See Also
Useful links:
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, adds the district logo
Description
Given a CDS code, adds the district logo
Usage
mcoe_d_logo(cds.number)
Arguments
cds.number |
County-District-School code from California Department of Education |
Value
'mcoe_d_logo' an object of class 'magick-image' from [magick::image_read()] which is an image file of the district logo
Examples
try(mcoe_d_logo("27659870000000"))
Adds the MCOE logo
Description
Adds the MCOE logo
Usage
mcoe_logo()
Value
'mcoe_logo' an object of class 'magick-image' from [magick::image_read()] which is an image file of the MCOE logo
Examples
mcoe_logo()
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)