r-data-io

Defines data reading and writing conventions for R projects using parquet, CSV, Excel, and databases.

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/chris-prener/dev-kit --skill r-data-io-chris-prener
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: r-data-io
Source: https://github.com/chris-prener/dev-kit/tree/main/dev-kit/skills/r-data-io
Command: npx skills add https://github.com/chris-prener/dev-kit --skill r-data-io-chris-prener

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? R projects often lack consistent conventions for reading and writing data, leading to fragile absolute paths, hardcoded credentials, inefficient formats, and unclosed database connections. This Skill standardizes data I/O so every file read, write, and database query follows the same portable, secure patterns. ## Core Features & Use Cases - Format Selection Guidance: Provides a decision table for choosing between parquet, CSV, Excel, RDS, QS, Feather, and JSON, defaulting to parquet for tabular data. - Database Connection Patterns: Covers DBI single connections, pool-based connection pooling for long-running processes, and DuckDB for querying parquet files directly without loading data into R. - Portable Paths and Secure Credentials: Enforces here::here() and fs::path() for file paths and environment variables for database credentials, eliminating hardcoded secrets. - Use Case: When building an R analysis that reads a large partitioned parquet dataset, filters it lazily with dplyr, and writes results back, this Skill supplies the exact arrow and fs code patterns to do it efficiently. ## Quick Start Ask the AI to write R code that reads a parquet file, connects to a Snowflake database with pooled connections, and writes the filtered results back to a partitioned parquet dataset.

Frequently Asked Questions about r-data-io

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read and write parquet files in R?▼

Use arrow::read_parquet() to read and arrow::write_parquet() to write parquet files in R. For efficiency, use col_select to read only needed columns, or arrow::open_dataset() with dplyr filters for row-level pushdown.

What data format should I use for tabular data in R?▼

Parquet is the recommended default for tabular data because it is columnar, compressed, type-preserving, and readable by Python, Spark, and DuckDB. Use CSV only for small human-readable data and Excel for business stakeholder exchange.

How do I connect R to a database with connection pooling?▼

Use pool::dbPool() with an odbc driver to create a connection pool with configurable minSize and maxSize. The pool automatically manages connection checkout and return, and you close it with pool::poolClose() when finished.

Can DuckDB query parquet files without loading them into R?▼

Yes, DuckDB can query parquet files directly using read_parquet() inside SQL statements through DBI. This lets you run aggregations and filters on disk-resident parquet files without loading full datasets into R memory.

Why should I avoid hardcoded file paths in R scripts?▼

Hardcoded absolute paths break when code runs on different machines or CI environments. Use here::here() or fs::path() to build portable, project-relative paths that work regardless of where the project is cloned.

How do I store database credentials securely in R projects?▼

Store credentials as environment variables in a gitignored .Renviron file and read them with Sys.getenv() in code. For CI and production, use GitHub secrets or vault integration instead of committing credentials to the repository.