Title: | Teaching Lab Custom R Development Package |
---|---|
Description: | Provides templates, palettes, and useful data analysis for Teaching Lab purposes. |
Authors: | Duncan Gates [aut, cre] |
Maintainer: | Duncan Gates <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1 |
Built: | 2024-11-20 05:23:07 UTC |
Source: | https://github.com/duncangates/TeachingLab |
Gets the percent that agree and strongly agree
agree_strongly_agree(data, question)
agree_strongly_agree(data, question)
data |
the data |
question |
a string - the question to get the percentage for |
a string
Gets the percent that agree and strongly agree with different variable names
agree_strongly_agree2(data, name)
agree_strongly_agree2(data, name)
data |
the data |
name |
a string - the question to get the percentage for |
a string
Calculate nps score
calc_nps(x)
calc_nps(x)
x |
A vector of nps scores |
Returns the nps score
With formula %
promoters - %
detractors where promoters are 9 or 10 ratings and detractors are 0 to 6
Verifies that an email is in a list
check_email_approved(email, approved_emails_list)
check_email_approved(email, approved_emails_list)
email |
the email provided |
approved_emails_list |
the email to check the list for |
TRUE or FALSE
Verifies that an email is of a specified domain
check_email_domain(email, domain)
check_email_domain(email, domain)
email |
the email provided |
domain |
the domain to check that it is from |
TRUE or FALSE
Takes all columns and splices them into dots for combination
coalesce_by_column(df)
coalesce_by_column(df)
df |
the dataframe |
the dataframe coalesced
df <- data.frame( a = c(1, 2, 3), b = c(NA, NA, NA), id = c("xxx", "xxx", "xxx") ) df %>% dplyr::group_by(id) %>% dplyr::summarise_all(TeachingLab::coalesce_by_column)
df <- data.frame( a = c(1, 2, 3), b = c(NA, NA, NA), id = c("xxx", "xxx", "xxx") ) df %>% dplyr::group_by(id) %>% dplyr::summarise_all(TeachingLab::coalesce_by_column)
Creates code to generate a color in x text with color, color.
colorize(x, color)
colorize(x, color)
x |
the text to be colored |
color |
the color of the text |
Returns a string with code to render the correctly colored text
Conditionally reduces the data
conditional_slice_sample(data, max)
conditional_slice_sample(data, max)
data |
the data |
max |
a max length to slice the data for |
a string
Wraps a function and conditionally performs it given certain arguments
conditionally(fun)
conditionally(fun)
fun |
the function to wrap |
library(dplyr) cond_filter <- conditionally(filter) cond_select <- conditionally(select)
library(dplyr) cond_filter <- conditionally(filter) cond_select <- conditionally(select)
Returns a barchart for selections in the relevant questions of the end of coaching survey
course_feedback_graph(race_filter = "All", content_area_filter = "All")
course_feedback_graph(race_filter = "All", content_area_filter = "All")
race_filter |
the filter to apply to the race column, one of "All", "White", "Black or African American", "Asian", "Hispanic/Latino", "More than one race", or "Other" |
content_area_filter |
the content area to filter for, one otf "All", "ELA", "Math", or "Other" |
prints a ggplot object
Creates a gt table for qualitative responses of the end of course survey
course_quotes( data = TeachingLab::get_course_survey(), size = 10, n = 3, all = F, save = NULL, include_columns = NULL )
course_quotes( data = TeachingLab::get_course_survey(), size = 10, n = 3, all = F, save = NULL, include_columns = NULL )
data |
the data to be input |
size |
the number of rows of quotes to return |
n |
The number of words to highlight |
all |
F by default, whether or not to return ALL data |
save |
NULL by default, a save path to make inside current package directory |
include_columns |
A vector of additional columns to include in table |
Returns a gt, unless save in which case it will return a saved file with gtsave
Creates a graph specifically for IPG Forms data
dashboard_ipg_plot( data, name, wrap = 60, sizing = 1, split = F, numeric = F, factor_level = NULL )
dashboard_ipg_plot( data, name, wrap = 60, sizing = 1, split = F, numeric = F, factor_level = NULL )
data |
the data |
name |
the column name for the data frame to focus on |
wrap |
passes to str_wrap for the title |
sizing |
the base text size multiplier |
split |
if it is sequenced by commas split it |
numeric |
if it is numeric reorder the factors |
factor_level |
option for factor levels |
a ggplot object
Creates a graph specifically for IPG Forms data
dashboard_ipg_plot_ts( data, name, wrap = 60, sizing = 1, split = F, numeric = F, factor_level = NULL )
dashboard_ipg_plot_ts( data, name, wrap = 60, sizing = 1, split = F, numeric = F, factor_level = NULL )
data |
the data |
name |
the column name for the data frame to focus on |
wrap |
passes to str_wrap for the title |
sizing |
the base text size multiplier |
split |
if it is sequenced by commas split it |
numeric |
if it is numeric reorder the factors |
factor_level |
option for factor levels |
a ggplot object
Creates a button that will expand or hide content
drop1(before = T, options, envir, name)
drop1(before = T, options, envir, name)
before |
button default, collapsed/not collapsed |
options |
unclear |
envir |
also unclear |
name |
chunk name |
html wrapper
Returns a barchart for selections in the relevant questions of the end of coaching survey
end_coaching_feedback_graph(race_filter = "All", content_area_filter = "All")
end_coaching_feedback_graph(race_filter = "All", content_area_filter = "All")
race_filter |
the filter to apply to the race column, one of "All", "White", "Black or African American", "Asian", "Hispanic/Latino", "More than one race", or "Other" |
content_area_filter |
the content area to filter for, one otf "All", "ELA", "Math", or "Other" |
prints a ggplot object
Creates a bar graph specifically for Knowledge Assessments for SXSW Report
fake_bar_graph_create( title, fake_data_fun = "p_and_n", custom_n_range = 0, custom_n = NULL, custom_x_axis_labels = NULL, custom_p_1 = NULL, custom_p_2 = NULL, randomness = 0, multiple_labels = NULL, know_graph = F )
fake_bar_graph_create( title, fake_data_fun = "p_and_n", custom_n_range = 0, custom_n = NULL, custom_x_axis_labels = NULL, custom_p_1 = NULL, custom_p_2 = NULL, randomness = 0, multiple_labels = NULL, know_graph = F )
title |
the title for the knowledge assessment to make plot for |
fake_data_fun |
p_and_n, p_and_n_split |
custom_n_range |
custom n range the number to add/subtract for random number generation |
custom_n |
custom n, one number |
custom_x_axis_labels |
custom x-axis labels |
custom_p_1 |
custom percentage 1, vector with 1: initial percentage, and 2: amount to set maximum increase |
custom_p_2 |
custom percentage 2, vector with 1: initial percentage, and 2: amount to set maximum increase |
randomness |
multiplier for amount of randomness in custom percentages, default 0 |
multiple_labels |
a special label maker to add group labels in bar charts |
know_graph |
if it is a knowledge assessments graph then add % correct to title |
a ggplot object
Creates a line graph specifically for Knowledge assessments for SXSW Report
fake_line_graph_create( title, fake_data_fun = "time_data", labels = c("Test 1", "Test 2"), x_axis = "yearly", y_axis_label = NULL, lines = 2, custom_n = NULL, custom_n_range = 0 )
fake_line_graph_create( title, fake_data_fun = "time_data", labels = c("Test 1", "Test 2"), x_axis = "yearly", y_axis_label = NULL, lines = 2, custom_n = NULL, custom_n_range = 0 )
title |
the title for the plot |
fake_data_fun |
time_data |
labels |
The labels for the lines |
x_axis |
the labels for the x-axis: yearly or pre-pl-post-pl |
y_axis_label |
A custom y axis label |
lines |
number of lines to create, either 1 or 2 |
custom_n |
custom n, one number |
custom_n_range |
custom n range the number to add/subtract for random number generation |
a ggplot object
Gives the file path without double slash bug
file.path2(..., fsep = .Platform$file.sep)
file.path2(..., fsep = .Platform$file.sep)
... |
The file path |
fsep |
the file separation |
fp a file path
Finds most common words in string
find_highlight(string, n = 3, print = F)
find_highlight(string, n = 3, print = F)
string |
the string to evaluate |
n |
the number of words to find |
print |
whether or not to print the highlighted words |
a vector of strings
First Letter Uppercase
first_up(x)
first_up(x)
x |
string |
string
Gets dashboard data by reading it in from data folder
get_course_survey(update = FALSE, year = "22_23")
get_course_survey(update = FALSE, year = "22_23")
update |
FALSE, optional to update end of course data or not |
year |
"21_22" or "22_23" |
Returns a tibble
Gets data from Google Sheet of partner sites
get_current_partner_sites(update = FALSE, year = "22_23")
get_current_partner_sites(update = FALSE, year = "22_23")
update |
FALSE, whether or not to pull the updated version |
year |
the year to get the site for |
Returns a tibble of sites
Get the diagnostic survey
get_diagnostic_survey(update = FALSE, year = "22_23")
get_diagnostic_survey(update = FALSE, year = "22_23")
update |
FALSE, optional updating |
year |
"21_22" or "22_23" |
A tibble
Gets data from the Ongoing Coaching Feedback Survey
get_end_coaching(update = FALSE, year = "22_23")
get_end_coaching(update = FALSE, year = "22_23")
update |
FALSE, whether or not to pull the updated version |
year |
"21_22" or "22_23" |
Returns a tibble
Gets data from the Follow Up Educator Survey
get_followup_educator(update = FALSE, year = "22_23")
get_followup_educator(update = FALSE, year = "22_23")
update |
FALSE, whether or not to pull the updated version |
year |
"21_22" or "22_23" |
Returns a tibble
Gets data from IPG forms
get_ipg_forms(update = FALSE, year = "22_23")
get_ipg_forms(update = FALSE, year = "22_23")
update |
FALSE |
year |
"21_22" or "22_23" |
Returns a tibble
Get the knowledge assessments survey
get_knowledge_assessments(update = FALSE, year = "22_23")
get_knowledge_assessments(update = FALSE, year = "22_23")
update |
FALSE, optional updating |
year |
"21_22" or "22_23" |
A tibble
Gets data from Lesson Plan Analysis forms
get_lesson_analysis(update = FALSE)
get_lesson_analysis(update = FALSE)
update |
FALSE |
Returns a tibble
Gets data from Coaching Participant Feedback
get_ongoing_coaching(update = FALSE, year = "22_23")
get_ongoing_coaching(update = FALSE, year = "22_23")
update |
FALSE, whether or not to pull the updated version |
year |
"21_22" or "22_23" |
Returns a tibble
Takes a date and finds the season
get_season(date)
get_season(date)
date |
the date |
the season
get_season(as.POSIXct("2016-01-01 12:00:00"))
get_season(as.POSIXct("2016-01-01 12:00:00"))
Gets dashboard data by reading it in from data folder
get_session_survey(update = FALSE, year = "22_23")
get_session_survey(update = FALSE, year = "22_23")
update |
FALSE, whether or not to update |
year |
"21_22" or "22_23" |
Returns a tibble
Get student scores for mississippi data
get_student_scores_mississippi(update = FALSE)
get_student_scores_mississippi(update = FALSE)
update |
FALSE, optional updating |
A tibble
Get student scores for follow up mississippi data
get_student_scores_mississippi2(update = FALSE)
get_student_scores_mississippi2(update = FALSE)
update |
FALSE, optional updating |
A tibble
Gets data from Student Survey
get_student_survey(update = FALSE, year = "22_23")
get_student_survey(update = FALSE, year = "22_23")
update |
FALSE whether or not to update the data |
year |
"21_22" or "22_23" |
Returns a tibble
Gets metadata about student work files
get_student_work(update = FALSE, year = "22_23")
get_student_work(update = FALSE, year = "22_23")
update |
FALSE, whether or not to pull the updated version |
year |
"21_22" or "22_23" |
Returns a tibble
Gets data from Google Sheet of partner sites
get_student_work_grades(year = "22_23")
get_student_work_grades(year = "22_23")
year |
the year to get the site for |
Returns a tibble of sites
function for grading different parts of the ipg forms
grade_ipg(x, type = "character")
grade_ipg(x, type = "character")
x |
the data |
type |
character or numeric |
a percentage of correct either by checking 3 or 4 or yes
Makes an html column for a gt table
gt_arrow(data, colors = c("#800000", "#98AFC7"), column_one, column_two)
gt_arrow(data, colors = c("#800000", "#98AFC7"), column_one, column_two)
data |
the gt table to make arrows for |
colors |
the color style to apply |
column_one |
The first column to compare |
column_two |
The second column to compare |
a colored gt table
gt_arrow(data = mtcars, colors = c("red", "blue"), column_one = cyl, column_two = disp)
gt_arrow(data = mtcars, colors = c("red", "blue"), column_one = cyl, column_two = disp)
Creates a graph specifically for Knowledge Assessments in mid year reports
gt_know_assess(data, know_assess)
gt_know_assess(data, know_assess)
data |
the data |
know_assess |
the knowledge assessment to make a table for |
a gt table
makes a gt table with percent and n colored
gt_percent_n( df, column, custom_title, no_title = T, base_font = 10, heading_font = 14, custom_column_name = "", viz_type = "gt" )
gt_percent_n( df, column, custom_title, no_title = T, base_font = 10, heading_font = 14, custom_column_name = "", viz_type = "gt" )
df |
the data frame |
column |
the column to get count and percent from |
custom_title |
the title for the table |
no_title |
make the table have no title |
base_font |
overall table font size |
heading_font |
title font size |
custom_column_name |
a custom name for the column |
viz_type |
gt by default, also has ggplot options like pie chart, waffle, or treemap |
a gt table
Create Teaching Lab theme to a gt table
gt_theme_tl( data, all_caps = F, align = "center", base_font = 16, heading_font = 20, ... )
gt_theme_tl( data, all_caps = F, align = "center", base_font = 16, heading_font = 20, ... )
data |
An existing gt table object |
all_caps |
Whether or not to capitalize titles |
align |
Align options are "left", "center", "right" or NULL |
base_font |
the font size |
heading_font |
the title font size |
... |
Optional additional arguments to gt::table_options() |
Creates a gt theme as a pipeable function
mtcars %>% utils::head() %>% gt::gt() %>% TeachingLab::gt_theme_tl()
mtcars %>% utils::head() %>% gt::gt() %>% TeachingLab::gt_theme_tl()
Makes a gt table with teaching lab color style
gt_tl_color(gt_table, color, column, scale = 1)
gt_tl_color(gt_table, color, column, scale = 1)
gt_table |
the gt table to color |
color |
the color style to apply |
column |
The column to apply the color to |
scale |
the scale to apply to |
a colored gt table
Helper function to extract a grob from gtables by name.
gtable_extract_grob(g, pattern = "guide-box")
gtable_extract_grob(g, pattern = "guide-box")
g |
the gtable to extract the grob |
pattern |
grob name or pattern to match |
g, a grob matching the specified pattern
Helper function to remove grobs by name, from gtables
gtable_remove_grob(g, pattern = "guide-box")
gtable_remove_grob(g, pattern = "guide-box")
g |
gtable with the grob removed |
pattern |
grob name or pattern to match |
g, with pattern removed.
Provides html formatted highlighting
highlight_fun(data, highlight = TeachingLab::find_highlight(data))
highlight_fun(data, highlight = TeachingLab::find_highlight(data))
data |
the data to highlight |
highlight |
the words to highlight |
a vector of strings
create an html dependency for bootstrap (function copied from rmarkdown)
html_dependency_bootstrap(theme = "bootstrap")
html_dependency_bootstrap(theme = "bootstrap")
theme |
"bootstrap" is the only option as of yet |
create an html dependency for jquery-stickytableheaders
html_dependency_jquery_stickytableheaders()
html_dependency_jquery_stickytableheaders()
create an html dependency for Magnific popup
html_dependency_magnific_popup()
html_dependency_magnific_popup()
Shared HTML template function
html_template( template_name, template_path, template_dependencies, pandoc_args, ... )
html_template( template_name, template_path, template_dependencies, pandoc_args, ... )
template_name |
template file name |
template_path |
template location |
template_dependencies |
js and css dependencies |
pandoc_args |
pandoc additional args |
... |
additional arguments to pass to pkgdown args |
Takes a string and inserts
at the requested intervals
html_wrap(string, n = 40)
html_wrap(string, n = 40)
string |
the string |
n |
the width of the string before a |
the same string with
inserted at the requested interval
html_wrap("a random string that has about 40 characters in it")
html_wrap("a random string that has about 40 characters in it")
takes initials and id column and makes an ID
id_maker(initials, birthday)
id_maker(initials, birthday)
initials |
the initials |
birthday |
the birthday |
Creates a graph specifically for IPG Forms data
ipg_plot( data, name, save_name, height = 5, width = 8.5, wrap = 60, sizing = 1, dpi = 300, split = F, numeric = F, factor_level = NULL, save = FALSE )
ipg_plot( data, name, save_name, height = 5, width = 8.5, wrap = 60, sizing = 1, dpi = 300, split = F, numeric = F, factor_level = NULL, save = FALSE )
data |
the data |
name |
the column name for the data frame to focus on |
save_name |
the name to save |
height |
height |
width |
width |
wrap |
passes to str_wrap for the title |
sizing |
the base text size multiplier |
dpi |
the dpi to save with |
split |
if it is sequenced by commas split it |
numeric |
if it is numeric reorder the factors |
factor_level |
option for factor levels |
save |
FALSE |
a ggplot
Creates a graph specifically for Knowledge Assessments in mid year reports
know_assess_summary(data, know_assess, summary_path = "report_summary_images")
know_assess_summary(data, know_assess, summary_path = "report_summary_images")
data |
the data |
know_assess |
the knowledge assessment to make plot for |
summary_path |
optional path to save plot to a file, if NULL does not save anywhere |
a ggplot
function to grade and output each question per respondent in a knowledge assessments survey
knowledge_assess_detailed_score(survey_id, survey_name)
knowledge_assess_detailed_score(survey_id, survey_name)
survey_id |
Qualtrics survey id |
survey_name |
Name of survey - should match Qualtrics name |
a dataframe of columns: prepost, site, know_assess, date, question, score, question2, answer, max_score
function to grade and output specific set of data points for knowledge assessments
knowledge_assess_select_score(survey_id, survey_name)
knowledge_assess_select_score(survey_id, survey_name)
survey_id |
Qualtrics survey id |
survey_name |
Name of survey - should match Qualtrics name |
a dataframe of columns: id, percent, prepost, site, know_assess, date
Conditionally changes the data
mutate_cond(.data, condition, ..., envir = parent.frame())
mutate_cond(.data, condition, ..., envir = parent.frame())
.data |
the data |
condition |
a specific condition to test for |
... |
additional arguments for mutate |
envir |
parent.frame() |
a string
Conditionally filters value given that it is not the first parameter, for use in shiny apps
neg_cond_filter(data, if_not_this, filter_this, dat_filter)
neg_cond_filter(data, if_not_this, filter_this, dat_filter)
data |
the dataframe to apply filter |
if_not_this |
If value is not this |
filter_this |
Filter for this |
dat_filter |
Data column object to filter |
filtered dataframe
Find elements x not in a vector y
x %!in% y
x %!in% y
x |
A vector of what shouldn't exist |
y |
A vector to check against |
Returns elements not in vector
Returns a barchart for selections in the relevant questions of the end of coaching survey
ongoing_coaching_feedback_graph( race_filter = "All", content_area_filter = "All" )
ongoing_coaching_feedback_graph( race_filter = "All", content_area_filter = "All" )
race_filter |
the filter to apply to the race column, one of "All", "White", "Black or African American", "Asian", "Hispanic/Latino", "More than one race", or "Other" |
content_area_filter |
the content area to filter for, one otf "All", "ELA", "Math", or "Other" |
prints a ggplot object
Creates fake data for knowledge assessments in SXSW report
p_and_n( p1_range = c(40:80), p2_range = c(70:100), n1_range = stats::rnorm(1, mean = 80, sd = 10), n2_range = stats::rnorm(1, mean = 50, sd = 10) )
p_and_n( p1_range = c(40:80), p2_range = c(70:100), n1_range = stats::rnorm(1, mean = 80, sd = 10), n2_range = stats::rnorm(1, mean = 50, sd = 10) )
p1_range |
the range of values to sample for p1 |
p2_range |
the range of values to sample for p2 |
n1_range |
the range of values to sample for n1 |
n2_range |
the range of values to sample for n2 |
a randomised dataset
Creates fake data for knowledge assessments in SXSW report
p_and_n_split( p1_1_range = c(30:70), p1_2_range = c(70:100), p2_1_range = c(80:95), p2_2_range = c(85:100), n1_range = stats::rnorm(1, mean = 80, sd = 10), n2_range = stats::rnorm(1, mean = 50, sd = 10) )
p_and_n_split( p1_1_range = c(30:70), p1_2_range = c(70:100), p2_1_range = c(80:95), p2_2_range = c(85:100), n1_range = stats::rnorm(1, mean = 80, sd = 10), n2_range = stats::rnorm(1, mean = 50, sd = 10) )
p1_1_range |
the lower range of values to sample for p1 |
p1_2_range |
the upper range of values to sample for p1 |
p2_1_range |
the lower range of values to sample for p2 |
p2_2_range |
the upper range of values to sample for p2 |
n1_range |
the range of values to sample for n1 |
n2_range |
the range of values to sample for n2 |
a randomised dataset
remove files from images/report_images and images/report_summary_images and render specified rmd
partner_file_remove(partner, content_area = NULL, input, output_dir, ...)
partner_file_remove(partner, content_area = NULL, input, output_dir, ...)
partner |
The partner to render a report for |
content_area |
content area to filter by default to NULL and ignored |
input |
the rmd to use to parametrically generate reports |
output_dir |
the output directory for the files |
... |
arguments passed to |
Creates a password of n length
password_generator(length = 8)
password_generator(length = 8)
length |
the length of the password |
a string
Calculates percent that are 4, 5, agree, or strongly agree
percent_agree(agree_col)
percent_agree(agree_col)
agree_col |
the vector or column to summarise |
integer
takes a dataframe and makes a gt table or ggplot that shows a quote
quote_viz( data, text_col = colnames(data)[1], viz_type = "gt", custom_highlight = NULL, n = 3, print = T, width = 60, title = NULL, suppress_warnings = T, align = "center", save = T, ... )
quote_viz( data, text_col = colnames(data)[1], viz_type = "gt", custom_highlight = NULL, n = 3, print = T, width = 60, title = NULL, suppress_warnings = T, align = "center", save = T, ... )
data |
the dataframe |
text_col |
columns to create table for |
viz_type |
ggplot or gt visualization |
custom_highlight |
a vector, optional custom highlighting |
n |
integer, number of words to auto-highlight |
print |
T, whether or not to print the highlighted words to console |
width |
The width of the table generated |
title |
the title of the ggplot or gt |
suppress_warnings |
T/F suppression of warnings |
align |
the table alignment: "left", "center", "right" |
save |
if TRUE actually make the gt |
... |
Arguments passed onto the gt table |
a ggplot/gt that visualizes text
## Not run: df <- TeachingLab::survey_monkey colnames(df)[1] <- "What learning are you excited to try?" quote_viz( data = df, text_col = "What learning are you excited to try?", viz_type = "gt", title = "Responses from Survey Monkey" ) ## End(Not run)
## Not run: df <- TeachingLab::survey_monkey colnames(df)[1] <- "What learning are you excited to try?" quote_viz( data = df, text_col = "What learning are you excited to try?", viz_type = "gt", title = "Responses from Survey Monkey" ) ## End(Not run)
Random Vector
rand_vect(N, M, sd = 1, pos.only = TRUE)
rand_vect(N, M, sd = 1, pos.only = TRUE)
N |
number of scalars to create |
M |
number to sum to |
sd |
Standard Deviation |
pos.only |
T |
Switches the labels and column names of a data frame, or just changes the column names to the labels
relabel_qualtrics_df(df, switch = TRUE)
relabel_qualtrics_df(df, switch = TRUE)
df |
the relevant dataframe |
switch |
T/F whether or not to switch the names |
a data.frame
## Not run: qualtrics_survey |> relabel_qualtrics_df() ## End(Not run)
## Not run: qualtrics_survey |> relabel_qualtrics_df() ## End(Not run)
Takes a whole number and "rounds" it to the nearest even number.
round_even(x)
round_even(x)
x |
the number to round |
an integer
round_even(17)
round_even(17)
round that actually round up 0.5 as it should be
rounding function as an alternative to round due to occasional decimal errors and problems with rounding from 0.5
round2(x, n)
round2(x, n)
x |
the vector to round |
n |
the number of digits to round |
the vector provided rounded
Generate one random number from a min and max
runif_round(min, max)
runif_round(min, max)
min |
the minimum number allowed |
max |
the maximum number allowed |
a single integer
See tl_palette()
.
scale_colour_tl(n, color = "blue", ...) scale_color_tl(n, color = "blue", ...) scale_fill_tl( n, color = c("blue", "orange", "purple", "green", "teal", "tl_colors"), ... )
scale_colour_tl(n, color = "blue", ...) scale_color_tl(n, color = "blue", ...) scale_fill_tl( n, color = c("blue", "orange", "purple", "green", "teal", "tl_colors"), ... )
n |
the number of colors |
color |
the color from |
... |
Arguments passed on to
|
Five thirty-eight style formatter for currency
scale_dollar_labels(labels)
scale_dollar_labels(labels)
labels |
vector of labels |
formatted percent labels
Five thirty-eight style formatter for percentages
scale_percent_labels(labels)
scale_percent_labels(labels)
labels |
vector of labels |
formatted percent labels
Five thirty-eight style formatter for Ratios
scale_ratio_labels(labels)
scale_ratio_labels(labels)
labels |
vector of labels |
formatted ratio labels
Makes a ggplot comparison table
score_compare_plot( data, question, order, prepost, score, split_variable, title )
score_compare_plot( data, question, order, prepost, score, split_variable, title )
data |
the data to use |
question |
the question column to use for comparison |
order |
the order to keep the questions in |
prepost |
The column to compare before and after |
score |
the scores to compare |
split_variable |
the text detected in the variable to create segments with (from prepost) |
title |
the title of the gt |
a colored gt table
## Not run: score_compare_plot(data, question, prepost, score) ## End(Not run)
## Not run: score_compare_plot(data, question, prepost, score) ## End(Not run)
Score a knowledge assessments question by selecting a grouping and choosing the percent that is correct
score_knowledge_question(data, question, correct)
score_knowledge_question(data, question, correct)
data |
the data to evaluate |
question |
a vector of questions |
correct |
a vector of correct answers |
a dataframe of format question1, question2, question3, with percents as answers
Calculate percentage correct for mindsets & expectations for just pre or post
score_one_question_mindsets( data, question, coding, na_remove = F, likert = c(5, 6) )
score_one_question_mindsets( data, question, coding, na_remove = F, likert = c(5, 6) )
data |
the dataframe to be analyzed |
question |
the initial column to be selected |
coding |
the coding to check for |
na_remove |
whether or not to drop NAs at the start of the evaluation |
likert |
whether or not the scale is likert with 5 points or 6 |
Returns a dataframe with the percent, correct, number of non-na responses, the question itself, and the percent that sustained/improved
Calculate percentage of a question (column) in data (data) that is in the right answer (coding)
score_question(data, question, coding, grouping = NULL)
score_question(data, question, coding, grouping = NULL)
data |
the dataframe to be analyzed |
question |
the column to be selected |
coding |
the coding to check for |
grouping |
NULL a vector of variables to group_by |
Returns a dataframe with the percent, correct, number of non-na responses, and question itself
Calculate percentage of a pre question (column) and post question (column) in data (data) that is in the right answer (coding).
score_question_improved( data, question_pre, question_post, coding, middle_value )
score_question_improved( data, question_pre, question_post, coding, middle_value )
data |
the dataframe to be analyzed |
question_pre |
the initial column to be selected |
question_post |
the comparison column to be selected |
coding |
the coding to check for |
middle_value |
the middle value to check for when calculating scores |
Returns a dataframe with the percent, correct, number of non-na responses, the question itself, and the percent that sustained/improved
Calculate percentage correct for mindsets & expectations
score_question_mindsets( data, question_pre, question_post, coding, na_remove = F, likert = c(5, 6) )
score_question_mindsets( data, question_pre, question_post, coding, na_remove = F, likert = c(5, 6) )
data |
the dataframe to be analyzed |
question_pre |
the initial column to be selected |
question_post |
the comparison column to be selected |
coding |
the coding to check for |
na_remove |
whether or not to drop NAs at the start of the evaluation |
likert |
whether or not the scale is likert with 5 points or 6 |
Returns a dataframe with the percent, correct, number of non-na responses, the question itself, and the percent that sustained/improved
Calculate percentage of a question (column) in data (data) that is on the positive or numeric side (coding) with a grading twist, where three is worth 1 and 1/2 or 4/5 is worth 2
score_question_number( data, question_pre, question_post, coding, likert = c(5, 6) )
score_question_number( data, question_pre, question_post, coding, likert = c(5, 6) )
data |
the dataframe to be analyzed |
question_pre |
the "pre-tl pl" column to be selected |
question_post |
the "post-tl pl"column to be selected |
coding |
the coding to check for |
likert |
whether the likert scale has 5 or 6 points |
Returns a dataframe with the percent, correct, number of non-na responses, and question itself
Gets all text over a specified nps and tibble
select_useful_text(data, text_col, name, n = 15)
select_useful_text(data, text_col, name, n = 15)
data |
the data to filter the text for |
text_col |
the text column to select |
name |
the new name for the text column |
n |
15 observations to return by default |
returns a single tibble column
finds the average sum of all selected columns
selection_sum(data, select, group = NULL)
selection_sum(data, select, group = NULL)
data |
the data |
select |
the data to select |
group |
the data to group by |
a tibble of the selected data's percent correct
Creates a plot for session survey data that shows % in each Likert category
session_agree_plot(data)
session_agree_plot(data)
data |
the data to be input |
Returns a ggplot
Creates a plot for session survey data with an adjustable time series component
session_agree_plot_ts(data, scale = "1 month")
session_agree_plot_ts(data, scale = "1 month")
data |
the data to be input |
scale |
the date scale to use for the plot |
Returns a ggplot
Returns a barchart for selections in the relevant questions of the end of coaching survey
session_feedback_graph(race_filter = "All Races", content_area_filter = "All")
session_feedback_graph(race_filter = "All Races", content_area_filter = "All")
race_filter |
the filter to apply to the race column, one of "All", "White", "Black or African American", "Asian", "Hispanic/Latino", "More than one race", or "Other" |
content_area_filter |
the content area to filter for, one otf "All", "ELA", "Math", or "Other" |
prints a ggplot object
Creates a gt table for qualitative responses to the end of session survey
session_quotes( data = TeachingLab::get_session_survey(), size = 10, n = 3, all = F, save = NULL, include_columns = NULL )
session_quotes( data = TeachingLab::get_session_survey(), size = 10, n = 3, all = F, save = NULL, include_columns = NULL )
data |
the data to be input |
size |
the number of rows of quotes to return |
n |
The number of words to highlight |
all |
Whether or not to return ALL data |
save |
NULL by default, a save path to make inside current package directory |
include_columns |
A vector of additional columns to include in table |
Returns a gt, unless save in which case it will return a saved file with gtsave
Gets all unique elements of a vector in a sorted view
single_sort_view(vector)
single_sort_view(vector)
vector |
the vector to view |
a string
# example code c("stuff", "and", "more") |> single_sort_view()
# example code c("stuff", "and", "more") |> single_sort_view()
English stop words from three lexicons, as a data frame. The snowball and SMART sets are pulled from the tm package. Note that words with non-ASCII characters have been removed.
A data frame with 1149 rows and 2 variables:
An English word
The source of the stop word. Either "onix", "SMART", or "snowball"
Detects a specific string pattern and replaces entire string with it
string_replace(string, string_detect, string_replace, print = FALSE)
string_replace(string, string_detect, string_replace, print = FALSE)
string |
the string to look within |
string_detect |
the string to detect |
string_replace |
the string to replace detected string with |
print |
FALSE whether or not to print the string |
a string
Automatically dodged bar chart for student data
student_bar_chart( data, col_select, agree_select, string_remove, title, legend_position = c(0.8, 0.25), race_filter = "All" )
student_bar_chart( data, col_select, agree_select, string_remove, title, legend_position = c(0.8, 0.25), race_filter = "All" )
data |
the data for the plotter to use, should include all columns of interest |
col_select |
the columns to select with |
agree_select |
the type of agree/strongly agree to select, for example also often/always |
string_remove |
NULL by default, provides an optional string removal |
title |
the title for the plot |
legend_position |
c(0.8, 0.25) by default, adjustable |
race_filter |
a parameter to filter for a specific race from the survey |
a ggplot object
Survey monkey reviews from the course survey in response to the question What is the learning from this course that you are most excited about trying out?, as a data frame.
A data frame with 87 rows and 1 variable
https://www.surveymonkey.com/r/TLendofcourse
Makes a gt table for mindsets question set
table_maker( data, column_names, title, spanner, n1, n2, rows_positive, rows_negative, improve_col, bottom_row )
table_maker( data, column_names, title, spanner, n1, n2, rows_positive, rows_negative, improve_col, bottom_row )
data |
the dataframe to be analyzed |
column_names |
the names of the columns |
title |
The tables title |
spanner |
The gt spanner |
n1 |
the n for fall |
n2 |
the n for spring |
rows_positive |
the positive rows |
rows_negative |
the negative_rows |
improve_col |
name for the improve/sustain column |
bottom_row |
the bottom row which has "n = " instead of data |
Returns an unsaved gt table
Creates a temporary save location for an image and return it with knitr::include_graphics
temp_save(img)
temp_save(img)
img |
the object to save as an image |
a png image
A theme for Teaching Lab RMD Reports
theme_final_report()
theme_final_report()
a ggplot object
It requires installing Calibri fonts unless you change the font parameters
theme_irp( base_family = "Roboto Condensed", base_size = 11, strip_text_family = "Futura Medium", strip_text_size = 12, plot_title_family = "Futura Medium", plot_title_size = 18, plot_title_margin = 10, subtitle_family = "Roboto Condensed", subtitle_size = 12, subtitle_margin = 15, caption_family = "Roboto Condensed", caption_size = 9, caption_margin = 10, axis_title_family = "Roboto Condensed", axis_title_size = 9, axis_title_just = "mm", dark = FALSE, grid = TRUE, axis = FALSE, ticks = FALSE )
theme_irp( base_family = "Roboto Condensed", base_size = 11, strip_text_family = "Futura Medium", strip_text_size = 12, plot_title_family = "Futura Medium", plot_title_size = 18, plot_title_margin = 10, subtitle_family = "Roboto Condensed", subtitle_size = 12, subtitle_margin = 15, caption_family = "Roboto Condensed", caption_size = 9, caption_margin = 10, axis_title_family = "Roboto Condensed", axis_title_size = 9, axis_title_just = "mm", dark = FALSE, grid = TRUE, axis = FALSE, ticks = FALSE )
base_family |
base font family |
base_size |
base font size |
strip_text_family |
facet label font family |
strip_text_size |
facet label text size |
plot_title_family |
plot tilte family |
plot_title_size |
plot title font size |
plot_title_margin |
plot title margin |
subtitle_family |
plot subtitle family |
subtitle_size |
plot subtitle size |
subtitle_margin |
plot subtitle margin |
caption_family |
plot caption family |
caption_size |
plot caption size |
caption_margin |
plot caption margin |
axis_title_family |
axis title font family |
axis_title_size |
axis title font size |
axis_title_just |
axis title font justification |
dark |
axis |
grid |
panel grid ( |
axis |
axis |
ticks |
ticks axis |
It requires installing Roboto, Calibri fonts unless you change the font parameters
theme_tl( base_family = "Calibri", base_size = 14, strip_text_family = base_family, strip_text_size = 15, plot_title_family = "Calibri", plot_title_size = 20, plot_title_margin = 10, subtitle_family = "Roboto", subtitle_size = 15, subtitle_margin = 15, caption_family = "Roboto", caption_size = 11, caption_margin = 10, axis_title_family = "Calibri", axis_title_size = 12, axis_title_just = "mm", axis_text_size = 10.5, dark = FALSE, grid = TRUE, axis = FALSE, ticks = FALSE, markdown = FALSE, legend = F )
theme_tl( base_family = "Calibri", base_size = 14, strip_text_family = base_family, strip_text_size = 15, plot_title_family = "Calibri", plot_title_size = 20, plot_title_margin = 10, subtitle_family = "Roboto", subtitle_size = 15, subtitle_margin = 15, caption_family = "Roboto", caption_size = 11, caption_margin = 10, axis_title_family = "Calibri", axis_title_size = 12, axis_title_just = "mm", axis_text_size = 10.5, dark = FALSE, grid = TRUE, axis = FALSE, ticks = FALSE, markdown = FALSE, legend = F )
base_family |
base font family |
base_size |
base font size |
strip_text_family |
facet label font family |
strip_text_size |
facet label text size |
plot_title_family |
plot title family |
plot_title_size |
plot title font size |
plot_title_margin |
plot title margin |
subtitle_family |
plot subtitle family |
subtitle_size |
plot subtitle size |
subtitle_margin |
plot subtitle margin |
caption_family |
plot caption family |
caption_size |
plot caption size |
caption_margin |
plot caption margin |
axis_title_family |
axis title font family |
axis_title_size |
axis title font size |
axis_title_just |
axis title font justification |
axis_text_size |
axis text size |
dark |
dark mode |
grid |
panel grid ( |
axis |
axis |
ticks |
ticks |
markdown |
enabled ggtext markdown styling |
legend |
default no legend with F |
Automatically scaled stacked bar chart with TL theming
tl_likert(data, title = "% Selected", string_remove = NULL, string_wrap = 80)
tl_likert(data, title = "% Selected", string_remove = NULL, string_wrap = 80)
data |
the data for the plotter to use, should include all columns of interest |
title |
the title for the plot |
string_remove |
NULL by default, provides an optional string removal |
string_wrap |
80 by default, the amount by which to wrap y axis text |
a ggplot object
A muted, qualitative color palette
tl_pal()
tl_pal()
## Not run: library(scales) scales::show_col(tl_pal_blue()(9)) ## End(Not run)
## Not run: library(scales) scales::show_col(tl_pal_blue()(9)) ## End(Not run)
TL Default Blue Palette
tl_pal_blue
tl_pal_blue
An object of class character
of length 8.
Teaching Lab Color Palette Maker
tl_palette( color = c("blue", "orange", "purple", "green", "teal", "tl_colors"), theme = c("dark"), n = 6 )
tl_palette( color = c("blue", "orange", "purple", "green", "teal", "tl_colors"), theme = c("dark"), n = 6 )
color |
the color palette to generate |
theme |
if theme is light or dark |
n |
number of colors to generate |
color ramp palette function
function for grading in general
tl_score(data, answer)
tl_score(data, answer)
data |
the data |
answer |
the answer |
a percentage of correct
function for generally getting the count of a data that is correct
tl_score_count(data, answer)
tl_score_count(data, answer)
data |
the data |
answer |
the answer |
a count of correct
function for grading in general
tl_score_numeric(x)
tl_score_numeric(x)
x |
the numbers to apply to |
a rounded average
data
in answer
function for general grading of percentages
tl_score_percent(data, answer)
tl_score_percent(data, answer)
data |
the data |
answer |
the answer |
a vector percent of correct
Automatically scaled stacked bar chart with TL theming
tl_select_percent(data, percent_equal)
tl_select_percent(data, percent_equal)
data |
the data for the plotter to use, should include all columns of interest |
percent_equal |
string inputs to find the percent of the column that equals those values |
a percentage as a string
Creates tables for responses to the Educator Diagnostic Survey
tl_summary_table( data, save = F, summarise = T, grouping = NULL, n_size = NULL, n_size_single = NULL, explain = F, prepost = T, admin = F, rename = F )
tl_summary_table( data, save = F, summarise = T, grouping = NULL, n_size = NULL, n_size_single = NULL, explain = F, prepost = T, admin = F, rename = F )
data |
the data to be input |
save |
F by default, a save path inside current working directory |
summarise |
TRUE by default will summarise all data selected |
grouping |
includes "equitable", "high_expectations", and "crse" |
n_size |
NULL an optional n_size to include |
n_size_single |
NULL an optional single value for n_size |
explain |
add explanation for different percentage levels to the table |
prepost |
F by default for making a prepost dataframe |
admin |
F by default for prepost admin dataframe |
rename |
F by default for making prepost dataframe |
Returns a gt table, unless save in which case it will return a saved file with gtsave
Format for converting from R Markdown to an HTML document.
TLDefault( fig_width = 8, fig_height = 5, fig_caption = TRUE, highlight = "kate", lightbox = FALSE, thumbnails = FALSE, gallery = FALSE, toc_depth = 2, embed_fonts = TRUE, fontawesome = TRUE, use_bookdown = FALSE, pandoc_args = NULL, md_extensions = NULL, mathjax = "rmdformats", ... )
TLDefault( fig_width = 8, fig_height = 5, fig_caption = TRUE, highlight = "kate", lightbox = FALSE, thumbnails = FALSE, gallery = FALSE, toc_depth = 2, embed_fonts = TRUE, fontawesome = TRUE, use_bookdown = FALSE, pandoc_args = NULL, md_extensions = NULL, mathjax = "rmdformats", ... )
fig_width |
Default width (in inches) for figures |
fig_height |
Default width (in inches) for figures |
fig_caption |
|
highlight |
Syntax highlighting style. Supported styles include
"default", "tango", "pygments", "kate", "monochrome", "espresso",
"zenburn", "haddock", and "textmate". Pass |
lightbox |
if TRUE, add lightbox effect to content images |
thumbnails |
if TRUE display content images as thumbnails |
gallery |
if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display |
toc_depth |
adjust table of contents depth |
embed_fonts |
if TRUE, use local files for fonts used in the template. This leads to bigger files but ensures that these fonts are available. If FALSE they are downloaded from Google Web Fonts. |
fontawesome |
if TRUE use fontawesome dependencies |
use_bookdown |
if TRUE, uses |
pandoc_args |
arguments passed to the pandoc_args argument of rmarkdown |
md_extensions |
arguments passed to the md_extensions argument of rmarkdown |
mathjax |
set to NULL to disable Mathjax insertion |
... |
Additional function arguments passed to R Markdown |
CSS adapted from the readtheorg theme of the org-html-themes project : https://github.com/fniessen/org-html-themes, which is itself inspired by the Read the docs theme : https://readthedocs.org/.
R Markdown output format to pass to render