Wrangling Functions
read_dirt_engagement_data
Import untidy student engagement csv file as an R dataframe object
Description:
Import untidy student engagement csv file as an R dataframe object
Usage:
read_dirt_engagement_data(input_course)
Arguments:
input_course: Name of course directory (ex. psyc1, spd1, marketing,
etc)
Value:
tower_engage: Dataframe containing student engagement information
with videos and problems
Examples:
read_dirt_engagement_data(input_course = 'psyc1')
clean_engagement_data
Remove initial messy strings in module_id column and rename mode column
Description:
Remove initial messy strings in module_id column and rename mode
column
Usage:
clean_engagement_data(dirt_engagement_data)
Arguments:
dirt_engagement_data: tower_engage_dirt dataframe object
Value:
dirt_engagement_data : tidy dataframe adter wrangling
Examples:
clean_engagement_data(dirt_engagement_data = obtain_dirt_engagement_data)
write_tidy_engagement_data
Write cleaned data as a csv into the specified course directory
Description:
Write cleaned data as a csv into the specified course directory
Usage:
write_tidy_engagement_data(input_course, cleaned_data)
Arguments:
input_course: Name of course directory (ex. psyc1, spd1, marketing,
etc)
cleaned_data: Dataframe containing cleaned data.
Examples:
write_tidy_engagement_data(input_course = 'psyc1', cleaned_data = clean_engagement_data)
wrangle_overview_engagement
This function automatically reads a file named "tower_engage_dirt.csv"
from the specified course directory and output a clean files named
"tower_engage.csv" in the same directory
Description:
This function automatically reads a file named
"tower_engage_dirt.csv" from the specified course directory and
output a clean files named "tower_engage.csv" in the same
directory
Usage:
wrangle_overview_engagement(input_course)
Arguments:
input_course: String of course directory name
Examples:
wrangle_video(input_course = "psyc1")
Server Functions
filter_chapter_overview
Filter course items dataframe by the selected course module
Description:
Filter course items dataframe by the selected course module
Usage:
filter_chapter_overview(input_df, module = "All")
Arguments:
module: One of the modules of the course.
item_df: The course items dataframe.
Value:
A dataframe filtered by the selected course module.
Examples:
filter_chapter_overview(tower_item, "all")
get_module_vector
Create a module name vector sorted by the course structure index. This
vector is used in the module filtering select box in ui.R
Description:
Create a module name vector sorted by the course structure index.
This vector is used in the module filtering select box in ui.R
Create a module name vector sorted by the course structure
index.This vector is used in the module filtering select box in
ui.R
Usage:
get_module_vector(item_df)
get_module_vector(item_df)
Arguments:
item_df:
item_df: The course axis dataframe
Value:
chap_name
chap_name A vector containg all unique module names.
Examples:
get_module_vector(item_df = tower_item)
create_module_name
Create a new column "chapter_name" for course item dataframe in order
to implement module filtering
Description:
Create a new column "chapter_name" for course item dataframe in
order to implement module filtering
Usage:
create_module_name(item_df)
Arguments:
item_df: A course axis dataframe only containing item name
Value:
item_df A coure axis dataframe adding chapter_name column
Examples:
create_module_name(item_df = tower_item)
get_nactive
Compute how many students engaged with each course item after filtering
student demographic
Description:
Compute how many students engaged with each course item after
filtering student demographic
Usage:
get_nactive(detail_df)
Arguments:
detail_df: Filtered student engagement dataframe
Value:
summary_df Summarized-view of engagement dataframe.
Examples:
get_nactive(detail_df = tower_engage)
join_engagement_item
Join filtered summary engagement dataframe with filtered item dataframe
to match "item " ,"item name" and "nactive" convert all module item
nacitve number to a constant to draw seperator line later
Description:
Join filtered summary engagement dataframe with filtered item
dataframe to match "item " ,"item name" and "nactive" convert all
module item nacitve number to a constant to draw seperator line
later
Usage:
join_engagement_item(filtered_engagement, filtered_item)
Arguments:
filtered_engagement: Filtered engagement dataframe.
filtered_item: Filtered course axis dataframe
Value:
tower_df Dataframe containing item name, item category and how
many student engaged with it
Examples:
join_engagement_item(filtered_engagement = filtered_tower_engage,filtered_item = filtered_tower_item)
get_module_nactive
Count how many filtered students engaged with the filtered course
module
Description:
Count how many filtered students engaged with the filtered course
module
Usage:
get_module_nactive(tower_df)
Arguments:
tower_df: Student engagement dataframe.
Value:
student_num A number refers to the maximum number of student
engaged with one item witin the selected course module.
Examples:
get_module_nactive(reactive_tower_df())
make_engagement_eiffel_tower
Make effiel tower plot : all video/problem course items vs. number of
engaging student
Description:
Make effiel tower plot : all video/problem course items vs. number
of engaging student
Usage:
make_engagement_eiffel_tower(tower_data)
Examples:
make_engagement_eiffel_tower(tower_data = reactive_tower_df())