An x3p file consists of a list with meta info and a 2d matrix with scan depths. fortify turns the matrix into a data frame, using the parameters of the header as necessary.
Examples
logo <- x3p_read(system.file("csafe-logo.x3p", package="x3ptools"))
logo_df <- x3p_to_df(logo)
head(logo_df)
#> x y value
#> 1 0.000e+00 0.00026961 4e-07
#> 2 6.450e-07 0.00026961 4e-07
#> 3 1.290e-06 0.00026961 4e-07
#> 4 1.935e-06 0.00026961 4e-07
#> 5 2.580e-06 0.00026961 4e-07
#> 6 3.225e-06 0.00026961 4e-07