Package 'gradecast'

Title: Calculate and visualize potential school grades
Description: Convert between German and US grades/GPA systems. Visualize potential final GPA based on current grades and remaining European Credit Transfer and Accumulation points (ECTS).
Authors: Pat Callahan [aut, cre] (ORCID: <https://orcid.org/0000-0003-1769-7580>)
Maintainer: Pat Callahan <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-05-16 05:34:28 UTC
Source: https://github.com/NeuroShepherd/gradecast

Help Index


Calculate grade range

Description

This function calculates the best and worst possible grade averages that can be achieved based on the current grade average, the number of ECTS credits already completed, and the number of remaining ECTS credits to complete.

Usage

calculate_grade_range(
  completed_ects,
  current_grade,
  remaining_ects,
  max_passing_grade = 1,
  min_passing_grade = 5
)

Arguments

completed_ects

the number of ECTS credits already completed

current_grade

the current grade average

remaining_ects

the number of ECTS credits remaining to complete

max_passing_grade

the best possible grade

min_passing_grade

the worst possible grade

Value

a vector with the best and worst possible grade averages

Examples

calculate_grade_range(120, 3.5, 60)
calculate_grade_range(120, 3.5, 60, 1, 5)

Caption builder

Description

Builds the text caption for the grade range plot. The caption can be optionally turned off on the ggplot2 object which is useful when the text is not needed or rendered well on the image file. Instead, the Shiny app creates a separate text box for the caption.

Usage

caption_builder(
  min_passing_grade,
  max_passing_grade,
  caption_width = 150,
  show_caption = TRUE
)

Arguments

min_passing_grade

the worst possible grade

max_passing_grade

the best possible grade

caption_width

text width for the caption. default 150

show_caption

whether or not to display the text caption

Value

a character string

Examples

caption_builder(min_passing_grade = 5, max_passing_grade = 1)

Convert grades to freedom units

Description

This function takes a vector of grade on the German scale and converts them to the "freedom units" scale i.e. to the equivalent American GPA scale. This calculation makes use of the so-called "Bavarian formula."

Usage

convert_to_freedom_units(grades, max_passing_grade = 4, min_passing_grade = 1)

Arguments

grades

a vector of grades on the German scale

max_passing_grade

the maximum passing grade score in the US. Should be 4 always

min_passing_grade

the minimum passing grade score in the US. Should be 1 always

Value

a vector of grades in "freedom units"

Examples

convert_to_freedom_units(grades = c(1.3, 2.8))

Plot grade range

Description

Plot grade range

Usage

plot_grade_range(
  completed_ects,
  current_grade,
  remaining_ects,
  max_passing_grade = 1,
  min_passing_grade = 5,
  show_caption = T,
  caption_width = 150
)

Arguments

completed_ects

the number of ECTS credits already completed

current_grade

the current grade average

remaining_ects

the number of ECTS credits remaining to complete

max_passing_grade

the best possible grade

min_passing_grade

the worst possible grade

show_caption

whether or not to display the text caption

caption_width

text width for the caption. default 150

Value

a ggplot2 object

Examples

# On the German scale
plot_grade_range(30, 1.5, 90)


# Now the same plot, but on the American scale and converting the grades.
# Note the `.` in the `plot_grade_range` function call. This is a placeholder
# for the result of the previous function call.

convert_to_freedom_units(1.5) %>%
  plot_grade_range(30, ., 90, max_passing_grade = 4, min_passing_grade = 1)

Run the Shiny Application

Description

Run the Shiny Application

Usage

run_app(
  onStart = NULL,
  options = list(),
  enableBookmarking = NULL,
  uiPattern = "/",
  ...
)

Arguments

onStart

A function that will be called before the app is actually run. This is only needed for shinyAppObj, since in the shinyAppDir case, a global.R file can be used for this purpose.

options

Named options that should be passed to the runApp call (these can be any of the following: "port", "launch.browser", "host", "quiet", "display.mode" and "test.mode"). You can also specify width and height parameters which provide a hint to the embedding environment about the ideal height/width for the app.

enableBookmarking

Can be one of "url", "server", or "disable". The default value, NULL, will respect the setting from any previous calls to enableBookmarking(). See enableBookmarking() for more information on bookmarking your app.

uiPattern

A regular expression that will be applied to each GET request to determine whether the ui should be used to handle the request. Note that the entire request path must match the regular expression in order for the match to be considered successful.

...

arguments to pass to golem_opts. See '?golem::get_golem_options' for more details.