Package: autoharp 0.3.2

Agrawal Naman

autoharp: Semi-Automatic Grading of R and Rmd Scripts

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.

Authors:Vik Gopal [aut], Agrawal Naman [aut, cre], Yuting Huang [ctb], Samuel Seah [aut], Viknesh Jeya Kumar [aut], Gabriel Ang [aut], Ruofan Liu [ctb], National University of Singapore [cph]

autoharp_0.3.2.tar.gz
autoharp_0.3.2.zip(r-4.7-any)autoharp_0.3.2.zip(r-4.6-any)autoharp_0.3.2.zip(r-4.5-any)
autoharp_0.3.2.tgz(r-4.6-any)autoharp_0.3.2.tgz(r-4.5-any)
autoharp_0.3.2.tar.gz(r-4.7-any)autoharp_0.3.2.tar.gz(r-4.6-any)
autoharp_0.3.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
autoharp/json (API)

# Install 'autoharp' in R:
install.packages('autoharp', repos = c('https://namanlab.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/namanlab/autoharp/issues

Pkgdown/docs site:https://namanlab.github.io

On CRAN:

Conda:

5.47 score 1 stars 28 scripts 617 downloads 64 exports 56 dependencies

Last updated from:26f55b1e03. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK129
source / vignettesOK183
linux-releaseOK115
macos-releaseOK106
macos-oldrelOK113
windows-develOK94
windows-releaseOK93
windows-oldrelOK87
wasm-releaseOK131

Exports:%>%apply_can_improve_thiscarve_mstcarve_subtreecheck_correctnesscheck_rmdcheck_runtimeclean_dircopy_e2ecount_fn_callcount_fn_in_fncount_lam_fncount_lints_allcount_lints_onecount_num_lines_for_loopcount_self_fndetect_fn_argdetect_fn_call_in_fordetect_for_in_fn_defdetect_growingdetect_nested_forenv_sizeextract_actual_argsextract_assigned_objectsextract_chunksextract_fn_callextract_formal_argsextract_non_chunksextract_section_textextract_self_fnfapplyfind_branch_numgenerate_all_subtreesgenerate_thumbnailsget_adj_listget_child_idsget_librariesget_next_subtreeget_node_typesget_parent_call_idget_parent_idget_recursive_indexis_subtree_rooted_atjaccard_treeharpjoin_treeharpsK2keep_brancheslang_2_treelog_summaryonly_actual_args_differpath_to_rootpipe_can_improve_thisplotpopulate_soln_envprune_depthrender_onerender_prechecksreplace_sp_chars_filenamereset_pathrmd_to_forestharprmd_to_token_countshowsubtree_atTreeHarp

Dependencies:base64encbslibcachemclicodetoolscommonmarkcpp11digestdplyrevaluatefastmapfontawesomefsgenericsgluehighrhtmltoolshttpuvigraphjquerylibjsonliteknitrlaterlatticelifecyclelintrmagrittrMatrixmemoisemimeotelpillarpkgconfigpromisesR6rappdirsRcpprexrlangrmarkdownsassshinysourcetoolsstringistringrtibbletidyselecttinytexutf8vctrswithrxfunxml2xmlparsedataxtableyaml

Getting Started with autoharp
What is autoharp? | The Big Picture: Four-Phase Workflow | Installation | Core Concepts | Solution Templates | The Grading Pipeline | Motivating Example | The Problem | Step 1: Create a Solution Template | Step 2: Populate the Solution Environment | Step 3: Grade a Student Submission | Step 4: Summarise Results Across All Students | Checking Code Style | Checking Rmd Structure | Interactive Grading with Shiny Apps | Next Steps | Getting Help

Last update: 2026-04-11
Started: 2026-03-27

Shiny App: Similarity Checks
Introduction

Last update: 2026-04-11
Started: 2026-03-27

Key Concepts
Working Directories | Environments | Forked R Processes | knitr Hooks | References

Last update: 2026-04-11
Started: 2026-03-27

Example Workflow: autoharp
Introduction | Description of Files | Student Scripts | Elements of the Framework | The Question Paper | The Solution Key or Template | How the Elements Work Together | Package Output

Last update: 2026-03-27
Started: 2026-03-27

Shiny App: Grading
Introduction | Session Management | Automated Object Testing | Template Generation | Autoharp Grading Integration | Manual Plot Grading

Last update: 2026-03-27
Started: 2026-03-27

Shiny App: Solution Checker

Last update: 2026-03-27
Started: 2026-03-27

TreeHarp S4 class
Introduction | Slots | adjList | nodeTypes | call | repr | TreeHarp Methods

Last update: 2026-03-27
Started: 2026-03-27

Readme and manuals

Help Manual

Help pageTopics
Convert adjacency list to a matrixadj_list_2_matrix
Identifies if an apply function can improve the codeapply_can_improve_this
TreeHarp Cast a TreeHarp to Matrix.as.matrix
autoharp: Semi-Automatic Grading of R and Rmd Scriptsautoharp-package autoharp
Carve a Minimal Spanning Tree Outcarve_mst
Carve out branches to form a new tree.carve_subtree
Check correctness of student solution rmd.check_correctness
Check if a File is Rmdcheck_rmd
Calculate Run-time Statisticscheck_runtime
Removes md Files when no HTML Presentclean_dir
Copy an object from one env to another.copy_e2e
Lint countercount_lints_all
File lint countercount_lints_one
Calculates the Total Memory Usedenv_size
Extract chunks that match a pattern.extract_chunks
Extract non-chunks from an Rmd file.extract_non_chunks
Extract section text from Rmdextract_section_text
Apply a function to a forest of trees.fapply
Find the branch that leads from one node to another.find_branch_num
Forestharp helperscount_fn_call count_fn_in_fn count_lam_fn count_num_lines_for_loop count_self_fn detect_fn_arg detect_fn_call_in_for detect_for_in_fn_def detect_growing detect_nested_for extract_actual_args extract_assigned_objects extract_fn_call extract_formal_args extract_self_fn forestharp-helpers
Generate all subtrees from a tree.generate_all_subtrees
Generate a html of thumbnailsgenerate_thumbnails
Generic for Getting Adjacency Listget_adj_list get_adj_list,TreeHarp-method
Generic for Getting Child Node Idsget_child_ids get_child_ids,list-method get_child_ids,TreeHarp-method
Get the children node idsget_child_ids2
Obtains the node levels from a tree.get_levels
Extracts the Packages Used in An Rmd File.get_libraries
Get the id and depth of a child node.get_next_depth_id
Generate the next sub-tree.get_next_subtree
Generic for Getting Node Typesget_node_types get_node_types,TreeHarp-method
Get Node Id of Parent Callget_parent_call_id
Generic for Getting Parent Node Id.get_parent_id get_parent_id,list-method get_parent_id,TreeHarp-method
Get the parent node idget_parent_id2
Obtain an index to extract out a sub-callget_recursive_index
Checks if a graph is connected.is_connected
Checks if a graph contains any cycles.is_cyclic_r
Checks if a tree is rooted at a node of another tree.is_subtree_rooted_at
Computes Jaccard Indexjaccard_treeharp
Root a list of trees.join_treeharps
Compute tree similarityK2
Keep only branches specified by node numberskeep_branches
Convert language object to tree.lang_2_tree
Generate a dataframe from the log file.log_summary
Convert adjacency matrix to a list.matrix_2_adj_list
Checks if two expressions differ only in terms of actual argumentsonly_actual_args_differ
Extract a path from node to root.path_to_root
Identify if use of pipe operator can improve a code sectionpipe_can_improve_this
TreeHarp Plotting TreeHarp Objectsplot,TreeHarp-method
Returns solution environment and test code from template.populate_soln_env
Prune a tree up to a specified depth.prune_depth
Update node information.rbind_to_nodes_info
Run a single Rmd file through autoharp.render_one
Conducts checks before rendering filerender_prechecks
Replace Special Characters in File Namereplace_sp_chars_filename
Reset search path of current R sessionreset_path
Convert to TreeHarp objectsrmd_to_forestharp
Count tokens in R/Rmdrmd_to_token_count
Extract a sub-tree.subtree_at
Function to rearrage nodes in BFSto_BFS
Compute tree similaritytree_sim
An R expression as a tree.length,TreeHarp-method names,TreeHarp-method show,TreeHarp-method TreeHarp TreeHarp,logical-method TreeHarp,missing-method TreeHarp-class
Update adjacency list.update_adj_list