writerPACI {rPACI} | R Documentation |
Save to disk a dataset in the format used by rPACI
Description
Write to disk a corneal topography dataset in the format used by rPACI, in a plain text file. The file format consists of (possibly) a header (only for data that were simulated), followed by three separated columns (x and y coordinates of each point and its ring index) and a row per data point. This format is returned by the functions readFile or simulateData.
Usage
writerPACI(dataset, filename, sep = ",")
Arguments
dataset |
A
| ||||||||||
filename |
A character string naming a file (including the extension). | ||||||||||
sep |
The field separator string (by default, ','). |
Details
This function writes the data from a data.frame
to a plain text file. The file will possibly have
a header, followed by a block of three separated columns, according to the usual format used by rPACI
,
i.e., a list with three columns (x and y coordinates of each point, and its ring index) and a row per data point.
If the given data.frame
(named dataset
) was produced using simulateData, the resulting
text file will also include in its header the Parameters
attribute (attr(dataset,'Parameters')
),
i.e., the list of parameters used for the simulation.
A file stored with writerPACI
can later be read using the general reader function readFile
or the specific reader function readrPACI.
See more details about the file structure in vignette("topographersDataFormat", package = "rPACI")
,
about the usage of rPACI
in vignette("packageUsage", package = "rPACI")
,
and about simulation parameters in vignette("simulating", package = "rPACI")
.
Examples
# Simulating an elliptic dataset, with ellipses axis ratio of 0.8 and an orientation
# of 45 degrees.
dataset = simulateData(rings = 18, pointsPerRing = 300,
ellipticAxesRatio = 0.8, ellipticRotation = 45)
# Now the dataset can be saved to file using 'writerPACI' (check the working directory
# before saving):
## Not run:
writerPACI(dataset, "datasetFile.txt")
## End(Not run)
# The file will include as a header the parameters used in the simulation