This function processes a dataset containing multiple subsets, each identified by a unique 'file' identifier, and converts each subset into a matrix based on binned 'Angle' and 'Intensity' values. It ensures consistent binning across all subsets by using global minimum and maximum values, facilitating direct comparison between the resulting matrices.
Value
A list containing: - matrices_list: A list where each element is a data frame corresponding to a subset identified by 'file', containing the original data. - bin_edges_Angle: Numeric vector of bin edges used for the 'Angle' dimension. - bin_edges_Intensity: Numeric vector of bin edges used for the 'Intensity' dimension. - counts_list: A list of matrices where each matrix represents the binned counts of 'Angle' and 'Intensity' for a subset.
Examples
if (FALSE) { # \dontrun{
# Assume 'data' is your dataset containing 'file', 'Angle', and 'Intensity' columns
result <- convert_to_image(data)
# Access the binned counts matrix for the first file
first_counts_matrix <- result$counts_list[[1]]
# Plot the matrix as an image
image(result$bin_edges_Angle, result$bin_edges_Intensity, first_counts_matrix)
} # }