| export_list | R Documentation | 
The export_list function exports a list of data.frame, data.table, or compatible data structures
with sophisticated directory handling, flexible naming, and multiple file format support.
export_list(split_dt, export_path = tempdir(), file_type = "txt")
| split_dt | A  | 
| export_path | Base directory path for file export. Defaults to a temporary directory
created by  | 
| file_type | File export format, either  | 
Comprehensive List Export Features:
Advanced nested directory structure support based on list element names
Intelligent handling of unnamed list elements
 Automatic conversion to data.table for consistent export
Hierarchical directory creation with nested path names
Multi-format file export with intelligent separator selection
Robust error handling and input validation
File Export Capabilities:
 Supports "txt" (tab-separated) and "csv" formats
Intelligent file naming based on list element names
Handles complex nested directory structures
 Efficient file writing using data.table::fwrite()
An integer representing the total number of files exported successfully.
Key Capabilities:
Flexible list naming and directory management
 Comprehensive support for data.frame and data.table inputs
Intelligent default naming for unnamed elements
High-performance file writing mechanism
# Example: Export split data to files
# Step 1: Create split data structure
dt_split <- w2l_split(
  data = iris,              # Input iris dataset
  cols2l = 1:2,             # Columns to be split
  by = "Species"            # Grouping variable
)
# Step 2: Export split data to files
export_list(
  split_dt = dt_split       # Input list of data.tables
)
# Returns the number of files created
# Files are saved in tempdir() with .txt extension
# Check exported files
list.files(
  path = tempdir(),         # Default export directory
  pattern = "txt",          # File type pattern to search
  recursive = TRUE          # Search in subdirectories
)
# Clean up exported files
files <- list.files(
  path = tempdir(),         # Default export directory
  pattern = "txt",          # File type pattern to search
  recursive = TRUE,         # Search in subdirectories
  full.names = TRUE         # Return full file paths
)
file.remove(files)          # Remove all exported files
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.