R Code for Regional Analysis: Automated Visualization and Image Export for Japanese Municipal Finance Using ggplot2 and patchwork 地域分析のためのRコード:ggplot2とpatchworkを用いた地方自治体財政指標の自動グラフ化および一括画像出力
Aug 2026· Zenodo (CERN European Organization for Nuclear Research)
Abstract
本Rスクリプトは、地方財政分析のために設計された、ggplot2およびpatchworkを活用した自動・高性能なグラフィック生成モジュールである。先行リポジトリ(https://zenodo.org/records/20258441)で構築したデータ抽出パイプラインのシームレスな可視化拡張として機能し、論文・報告書クオリティの個別チャートや複数指標を統合したダッシュボードを自動生成する。処理済みの財政データセットを動的にスキャンし、厳密な数値フォーマット(%表記の小数点第1位固定など)を適用しながら、ファイルの上書き防止機能を備えた高解像度画像を一括エクスポートする。コードの厳密な再現性と即時利用性を検証するため、実行時に直接生成された未加工のサンプルグラフ(豊山町_公債費負担比率.png)を同梱している。 生成AIの利用について 本レポジトリのコード作成には生成AIを利用した。V1.0まではGoogle Gemini、V2.0以降はClaude(Anthropic)を用いて作成した。出力の検証は著者が行い、内容の責任は著者が負う。 Version 2.0 Release: 決算状況調10年パネルへの対応 本バージョン(V2.0)では、原データの系統を追加した。従来の「財政状況資料集」に加え、「市町村別決算状況調」から作成した10年パネル(平成27〜令和6年度、https://doi.org/10.5281/zenodo.22144642)を入力として扱える。作図モジュールは変更しておらず、入力を作る前段(prepare_panel_for_graphics.R)を追加することで対応した。描画対象は13指標で、目的別歳出から2款を含む。豊山町(愛知県)で実行したサンプル画像を同梱している。 関連Rコード 【類似団体検索・列挙ツール】二自治体の財政比較を行う場合に便利な類似団体コードの同一の自治体を検索・列挙するRコード(Shiny)を作成しました。https://doi.org/10.5281/zenodo.20387194 【連動データ抽出・処理モジュール】 本スクリプトでの可視化に必要な複数年の自治体財政指標データを抽出・前処理(「地方自治体財政指標に関する財政状況資料集を用いた10年間集計エクセルデータ作成」)する際は、基盤となるデータ処理モジュール( https://doi.org/10.5281/zenodo.20258441 )を参照のこと。 [English] R Code for Regional Analysis: Automated Visualization and Image Export Using ggplot2 and patchwork This R script provides an automated, high-performance graphic generation module designed for regional fiscal analysis, leveraging the power of ggplot2 and patchwork to produce publication-ready individual charts and integrated multi-indicator dashboards. Operating as a seamless visualization extension to the primary data extraction pipeline established in the preceding repository (available at https://zenodo.org/records/20258441 ), this module dynamically scans processed financial datasets, enforces rigorous decimal formatting (e.g., standardizing percentage representations to ".1f%"), and batch-exports high-resolution assets with native file-overwrite protection. To verify the script's strict reproducibility and out-of-the-box utility, the accompanying sample graph (豊山町_公債費負担比率.png, showing the Debt Service Burden Ratio of Toyoyama Town) is provided as a raw, unaltered file directly generated by the execution of this code. Declaration of Generative AI Use Generative AI was used to write the code in this repository. The code up to version 1.0 was written with Google Gemini; from version 2.0 it has been written with Claude (Anthropic). The author has verified the output and takes responsibility for the content. Version 2.0 Release: Support for the Settlement Survey Ten-Year Panel This version adds a second family of source data. Alongside the Financial Status Documents used since version 1.0, the module now accepts the ten-year panel (FY2015–FY2024) built from the Local Government Financial Settlement Survey (市町村別決算状況調), deposited at https://doi.org/10.5281/zenodo.22144642. The plotting module (compile_municipal_finance_10years_graphics.R) is unchanged. It takes a data frame of one fiscal year per row and decides how to draw each indicator from the column name alone: columns marked as amounts are drawn as bar charts, columns whose name contains the word for ratio as percentage lines, and the remainder as index lines. Because the interface is a data frame rather than a file format, supporting a different source requires only a new front end. The script added here, prepare_panel_for_graphics.R, selects one municipality from the panel by its code and assembles that data frame; the municipality and the expenditure categories to be drawn are set at the top of the script. Thirteen indicators are drawn. Six are amounts (total revenue, total expenditure, real balance, standard financial demand, standard financial revenue, standard fiscal scale), five are ratios or indices (index of financial capability, ratio of current expenditure to current revenue, real balance ratio, real debt service ratio, debt service burden ratio), and two are expenditure categories taken from the expenditure-by-purpose table (social welfare and civil engineering). Plotting expenditure categories over time is new in this version. Sample images produced by running the code on Toyoyama, Aichi Prefecture (municipality code 233421) are deposited as raw, unaltered output. Related R Code [Peer Municipality Search & Listing Tool] Developed an R Shiny application designed to search and list municipalities belonging to the same peer group code. This tool is highly useful for conducting comparative financial analysis between peer municipalities. https://doi.org/10.5281/zenodo.20387194 [Integrated Data Extraction & Processing Module] For extracting and preprocessing multi-year municipal financial indicator data required for visualization in this script (specifically, "Creating a 10-Year Aggregate Excel Dataset Using the Financial Status Documents on Local Government Financial Indicators"), please refer to the underlying data processing module. https://doi.org/10.5281/zenodo.20258441
Various recent Artificial Intelligence (AI) system failures, some of which have made the global headlines, have highlighted issues in these systems. These failures have resulted in calls for more ethical AI systems that better take into account their effects on various stakeholders. However, implementing AI ethics into practice is still an on-going challenge. High-level guidelines for doing so exist, devised by governments and private organizations alike, but lack practicality for developers. To address this issue, in this paper, we present a method for implementing AI ethics. The method, ECCOLA, has been iteratively developed using a cyclical action design research approach. The method aims at making the high-level AI ethics principles more practical, making it possible for developers to more easily implement them in practice.
Ville Vakkuri, Kai-Kristian Kemell, P. Abrahamsson· EUROMICRO Conference on Soft...· 64 citations· ⚡6
In this paper, we present a novel approach to improving software quality and efficiency through a Large Language Model (LLM)-based model designed to review code and identify potential issues. Our proposed LLM-based AI agent model is trained on large code repositories. This training includes code reviews, bug reports, and documentation of best practices. It aims to detect code smells, identify potential bugs, provide suggestions for improvement, and optimize the code. Unlike traditional static code analysis tools, our LLM-based AI agent has the ability to predict future potential risks in the code. This supports a dual goal of improving code quality and enhancing developer education by encouraging a deeper understanding of best practices and efficient coding techniques. Furthermore, we explore the model's effectiveness in suggesting improvements that significantly reduce post-release bugs and enhance code review processes, as evidenced by an analysis of developer sentiment toward LLM feedback. For future work, we aim to assess the accuracy and efficiency of LLM-generated documentation updates in comparison to manual methods. This will involve an empirical study focusing on manually conducted code reviews to identify code smells and bugs, alongside an evaluation of best practice documentation, augmented by insights from developer discussions and code reviews. Our goal is to not only refine the accuracy of our LLM-based tool but also to underscore its potential in streamlining the software development lifecycle through proactive code improvement and education.
Z. Rasheed, Malik Abdul Sami, Muhammad Waseem et al.· arXiv.org· 62 citations· ⚡3
In agile software development, maintaining high-quality user stories is crucial, but also challenging. This study explores the use of large language models to automatically improve the user story quality in Austrian Post Group IT agile teams. We developed a reference model for an Autonomous LLM-based Agent System and implemented it at the company. The quality of user stories in the study and the effectiveness of these agents for user story quality improvement was assessed by 11 participants across six agile teams. Our findings demonstrate the potential of LLMs in improving user story quality, contributing to the research on AI role in agile development, and providing a practical example of the transformative impact of AI in an industry setting.
Zheying Zhang, M. Rayhan, Tomas Herda et al.· International Conference on...· 48 citations· ⚡4
Systematic literature review (SLR) is foundational to evidence-based research, enabling scholars to identify, classify, and synthesize existing studies to address specific research questions. Conducting an SLR is, however, largely a manual process. In recent years, researchers have made significant progress in automating portions of the SLR pipeline to reduce the effort and time required for high-quality reviews; nevertheless, there remains a lack of AI-agent-based systems that automate the entire SLR workflow. To this end, we introduce a novel multi-AI-agent system designed to fully automate SLRs. Leveraging large language models (LLMs), our system streamlines the review process to enhance efficiency and accuracy. Through a user-friendly interface, researchers specify a topic; the system then generates a search string to retrieve relevant academic papers. Next, an inclusion/exclusion filtering step is applied to titles relevant to the research area. The system subsequently summarizes paper abstracts and retains only those directly related to the field of study. In the final phase, it conducts a thorough analysis of the selected papers with respect to predefined research questions. This paper presents the system, describes its operational framework, and demonstrates how it substantially reduces the time and effort traditionally required for SLRs while maintaining comprehensiveness and precision. The code for this project is available at: https://github.com/GPT-Laboratory/SLR-automation .
Malik Abdul Sami, Z. Rasheed, Kai-Kristian Kemell et al.· arXiv.org· 43 citations· ⚡2
The growing influence and decision-making capacities of Autonomous systems and Artificial Intelligence in our lives force us to consider the values embedded in these systems. But how ethics should be implemented into these systems? In this study, the solution is seen on philosophical conceptualization as a framework to form practical implementation model for ethics of AI. To take the first steps on conceptualization main concepts used on the field needs to be identified. A keyword based Systematic Mapping Study (SMS) on the keywords used in AI and ethics was conducted to help in identifying, defying and comparing main concepts used in current AI ethics discourse. Out of 1062 papers retrieved SMS discovered 37 re-occurring keywords in 83 academic papers. We suggest that the focus on finding keywords is the first step in guiding and providing direction for future research in the AI ethics field.
Ville Vakkuri, P. Abrahamsson· International Conference on...· 39 citations· ⚡2
Artificial Intelligence (AI) systems exert a growing influence on our society. As they become more ubiquitous, their potential negative impacts also become evident through various real-world incidents. Following such early incidents, academic and public discussion on AI ethics has highlighted the need for implementing ethics in AI system development. However, little currently exists in the way of frameworks for understanding the practical implementation of AI ethics. In this paper, we discuss a research framework for implementing AI ethics in industrial settings. The framework presents a starting point for empirical studies into AI ethics but is still being developed further based on its practical utilization.
Ville Vakkuri, Kai-Kristian Kemell, P. Abrahamsson· Conference on Technology Eth...· 27 citations· ⚡3