This function reads xpm (X PixMap) files, validates their existence, and returns parsed data structures in a list format.
Value
list with the following components:
data - Data frame containing matrix values with coordinates
title - Chart title extracted from xpm
legend - Legend text extracted from xpm
x_label - X-axis label extracted from xpm
y_label - Y-axis label extracted from xpm
color_map - Named list mapping color codes to hex values
color_values - Named list mapping color codes to numeric values
Details
The function performs the following operations:
Validates input type (must be character vector)
Checks for file existence and filters missing files with warnings
Reads valid files and parses them using
parse_xpm()
Returns aggregated results in a named list
Examples
# \donttest{
library(xvm)
# Retrieve the path to the example file included in the package
xpm_file_path <- system.file("extdata/gibbs.xpm", package = "xvm")
xpm_data <- read_xpm(xpm_file_path) # read the xpm file using read_xpm() function
#> Dimensions parsed: width = 32, height = 32, colors = 50
names(xpm_data)
#> [1] "gibbs.xpm"
# }