[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-83755-en":3,"doc-seo-83755-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},83755,137441390410,"Hazel","https://ap-avatar.wpscdn.com/avatar/2000252f4ab5702993?_k=1776741390130283984",8,"Research & Report","Inferring the Shape of Data Frames in R Programs using Abstract Interpretation","Data frames are central to data analysis in R, yet the language lacks static guarantees about column and row existence, making it hard to reason about a data frame’s shape at a given program point. The paper introduces a static analysis based on abstract interpretation that tracks ensured and potential column names plus potential counts of columns and rows, using reduced product domains and abstract semantics for key operations like mutating, filtering, and subsetting.","Inferring the Shape of Data Frames in R Programs using Abstract Interpretation  \nOliver Gerstl  \n[oliver.gerstl@uni-ulm.de](oliver.gerstl@uni-ulm.de)[ ](oliver.gerstl@uni-ulm.de)Ulm University Germany  \nFlorian Sihler  \n[florian.sihler@uni-ulm.de](florian.sihler@uni-ulm.de)[ ](florian.sihler@uni-ulm.de)Ulm University Germany  \nMatthias Tichy  \n[matthias.tichy@uni-ulm.de](matthias.tichy@uni-ulm.de)[ ](matthias.tichy@uni-ulm.de)Ulm University Germany  \narXiv :2607 .03889v 1 [ cs . SE] 4 Jul 2026  \nAbstract  \nData frames are a fundamental data structure in many data analysis tasks and are widely used in programming languages like R. Due to their omnipresence in data analysis, there are many functions that operate on their shape and content, for example, to clean and transform study data. However, languages like R do not offer static guarantees on data frames making it difficult to reason about their shape at a specific point in the program.  \nIn this paper, we present a novel static analysis to infer the shape of data frames in R programs using abstract interpretation by tracking the ensured and potential column names, as well as the potential number of columns and rows. For this, we use a reduced product domain and define abstract semantics for the most commonly used data frame operations, such as mutating, filtering, and subsetting. We evaluate the correctness and accuracy of our analysis on a selection of 78 executable real-world R scripts achieving empirical evidence for soundness by never under-approximating the data frame shape. Additionally, we demonstrate the ability of our analysis to infer the shape of data frames on a large dataset of 33,314 real-world R scripts by inferring concrete shape constraints for 42.1 % and exact shapes for 0.9 % of the data frame operations, improving to 58.7 % and 4.2 % if all datasets read in these scripts are available to our analysis. Using the inferred data frame shapes, we identified 40 real-world R scripts containing potential invalid data frame accesses. This shows the potential of our analysis to significantly support researchers in using data frames in data analysis.  \nCCS Concepts  \n• Software and its engineering → Automated static analysis;  \n• Theory of computation → Abstraction.  \nKeywords  \nAbstract Interpretation, Static Analysis, R Language, Data Frames  \n1 Introduction  \nProgramming languages like R, Python, and Julia are widely used in statistical computing and data analysis [1]. Hence, they are mostly used by researchers and data scientists that do not have a background in software engineering [2, 3] . Several studies show that research codes suffers from reproducibility issues because of bad coding practices [4, 5] . Moreover, these languages incorporate powerful reflective features, such as the evaluation of code from strings and the modification of function bodies at runtime [6, 7] .  \nOne of the most commonly used data structures in data science programs is the data frame, a tabular data structure for storing, transforming, and visualizing data [1] . However, dynamic programming languages like R do not provide a way to statically verify the  \nshape of data frames, for example, to guarantee the existence of accessed columns and rows of data frames. This may lead to subtle errors due to missing column names or out-of-bounds accesses for columns and rows of data frames when running the code. This is particularly important for programs performing long-running analyses where a dynamic analysis is not feasible.  \nThere are many static analysis tools for popular programming languages like Java and C/C++ [8, 9, 10] . However, there is a lack of sufficient static analysis tools to support researchers writing data science programs [11, 12] and using data science-specific data structures like data frames. Existing work on analyzing data frames focuses solely on Python and does not evaluate the effectiveness of their approach on real-world code [13, 14] .  \nIn this paper, we propo","cbCaitbVanP0x803","https://ap.wps.com/l/cbCaitbVanP0x803","pdf",813088,2,1,11,"English","en",105,"# Abstract\n# Introduction\n## Motivation and Challenges\n## Related Work\n## Proposed Approach\n## Research Questions","[{\"question\":\"Why is inferring the shape of data frames important in R programs?\",\"answer\":\"R cannot statically verify that accessed columns and rows exist, which can cause subtle runtime errors such as missing columns or out-of-bounds accesses, especially in long-running analyses.\"},{\"question\":\"How does the proposed analysis infer data frame shapes?\",\"answer\":\"It uses abstract interpretation with a reduced product domain that tracks ensured and potential column names, along with potential numbers of columns and rows, and defines abstract semantics for common operations like mutating, filtering, and subsetting.\"},{\"question\":\"What results does the evaluation report?\",\"answer\":\"On 78 executable real-world R scripts, the analysis provides empirical evidence for soundness without under-approximating the data frame shape, while identifying many actual data frames. On 33,314 scripts, it infers concrete and exact shape constraints for specific fractions of operations and flags scripts with potential invalid accesses.\"}]",1784190236,28,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"inferring-the-shape-of-data-frames-in-r-programs-using-abstract-interpretation","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,47,50],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":20},"https://docshare.wps.com/document/","Document",{"item":48,"name":12,"@type":43,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/inferring-the-shape-of-data-frames-in-r-programs-using-abstract-interpretation/83755/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-27","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"Why is inferring the shape of data frames important in R programs?","Question",{"text":75,"@type":76},"R cannot statically verify that accessed columns and rows exist, which can cause subtle runtime errors such as missing columns or out-of-bounds accesses, especially in long-running analyses.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How does the proposed analysis infer data frame shapes?",{"text":80,"@type":76},"It uses abstract interpretation with a reduced product domain that tracks ensured and potential column names, along with potential numbers of columns and rows, and defines abstract semantics for common operations like mutating, filtering, and subsetting.",{"name":82,"@type":73,"acceptedAnswer":83},"What results does the evaluation report?",{"text":84,"@type":76},"On 78 executable real-world R scripts, the analysis provides empirical evidence for soundness without under-approximating the data frame shape, while identifying many actual data frames. On 33,314 scripts, it infers concrete and exact shape constraints for specific fractions of operations and flags scripts with potential invalid accesses.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":20,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]