Learn R Programming

autoharp (version 0.0.13)

Semi-Automatic Grading of R and Rmd Scripts

Description

A customisable set of tools for assessing and grading R or R-markdown scripts from students. It allows for checking correctness of code output, runtime statistics and static code analysis. The latter feature is made possible by representing R expressions using a tree structure.

Copy Link

Version

Install

install.packages('autoharp')

Monthly Downloads

509

Version

0.0.13

License

MIT + file LICENSE

Maintainer

Agrawal Naman

Last Published

November 30th, 2025

Functions in autoharp (0.0.13)

generate_thumbnails

Generate a html of thumbnails
get_next_depth_id

Get the id and depth of a child node.
jaccard_treeharp

Computes Jaccard Index
get_adj_list

Generic for Getting Adjacency List
is_subtree_rooted_at

Checks if a tree is rooted at a node of another tree.
forestharp-helpers

Forestharp helpers
lang_2_tree

Convert language object to tree.
get_parent_call_id

Get Node Id of Parent Call
generate_all_subtrees

Generate all subtrees from a tree.
get_next_subtree

Generate the next sub-tree.
is_cyclic_r

Checks if a graph contains any cycles.
%>%

Pipe operator
plot,TreeHarp-method

TreeHarp Plotting TreeHarp Objects
is_connected

Checks if a graph is connected.
get_node_types

Generic for Getting Node Types
log_summary

Generate a dataframe from the log file.
path_to_root

Extract a path from node to root.
matrix_2_adj_list

Convert adjacency matrix to a list.
get_child_ids

Generic for Getting Child Node Ids
get_child_ids2

Get the children node ids
get_summary_output

Function to extract the summary content
get_recursive_index

Obtain an index to extract out a sub-call
rbind_to_nodes_info

Update node information.
remove_extension

Obtains the Root File Name, without Extension.
to_BFS

Function to rearrage nodes in BFS
subtree_at

Extract a sub-tree.
get_libraries

Extracts the Packages Used in An Rmd File.
env_size

Calculates the Total Memory Used
replace_sp_chars_filename

Replace Special Characters in File Name
render_one

Run a single Rmd file through autoharp.
rmd_to_forestharp

Convert to TreeHarp objects
reset_path

Reset search path of current R session
tree_sim

Compute tree similarity
update_adj_list

Update adjacency list.
prune_depth

Prune a tree up to a specified depth.
populate_soln_env

Returns solution environment and test code from template.
get_parent_id2

Get the parent node id
keep_branches

Keep only branches specified by node numbers
get_parent_id

Generic for Getting Parent Node Id.
extract_chunks

Extract chunks that match a pattern.
rmd_to_token_count

Count tokens in R/Rmd
join_treeharps

Root a list of trees.
run_tuner

Runs the student-facing feedback app
autoharp

autoharp: Semi-Automatic Grading of R and Rmd Scripts
TreeHarp-class

An R expression as a tree.
K2

Compute tree similarity
adj_list_2_matrix

Convert adjacency list to a matrix
check_runtime

Calculate Run-time Statistics
check_rmd

Check if a File is Rmd
carve_mst

Carve a Minimal Spanning Tree Out
check_correctness

Check correctness of student solution rmd.
carve_subtree

Carve out branches to form a new tree.
as.matrix

TreeHarp Cast a TreeHarp to Matrix.
fapply

Apply a function to a forest of trees.
extract_non_chunks

Extract non-chunks from an Rmd file.
find_branch_num

Find the branch that leads from one node to another.
extract_section_text

Extract section text from Rmd
count_lints_one

File lint counter
count_lints_all

Lint counter
get_levels

Obtains the node levels from a tree.
clean_dir

Removes md Files when no HTML Present
copy_e2e

Copy an object from one env to another.