View source: R/ifcb_create_manual_file.R
| ifcb_create_manual_file | R Documentation |
Generates a .mat file for IFCB data with classification structure using a specified number of ROIs,
class names. The output_file generated by this function is
compatible with the code in the ifcb-analysis repository (Sosik and Olson 2007).
ifcb_create_manual_file(
roi_length,
class2use,
output_file,
classlist = 1,
do_compression = TRUE
)
roi_length |
Integer. The number of rows in the class list (number of ROIs). |
class2use |
Character vector. The names of the classes to include in the |
output_file |
Character. The path where the output MAT file will be saved. |
classlist |
Integer or numeric vector. Defines the values for the second column of the class list, typically representing the manual classification labels:
|
do_compression |
A logical value indicating whether to compress the .mat file. Default is TRUE. |
Python must be installed to use this function. The required python packages can be installed in a virtual environment using ifcb_py_install().
No return value. This function is called for its side effects.
The created MAT file is saved at the specified output_file location.
Sosik, H. M. and Olson, R. J. (2007), Automated taxonomic classification of phytoplankton sampled with imaging-in-flow cytometry. Limnol. Oceanogr: Methods 5, 204–216.
## Not run:
# Initialize a python session if not already set up
ifcb_py_install()
# Create a MAT file with 100 ROIs, using a vector of class names, and save it to "output.mat"
ifcb_create_manual_file(roi_length = 100,
class2use = c("unclassified", "Aphanizomenon_spp"),
output_file = "output.mat")
# Create a MAT file with 50 unclassified ROIs (1) and 50 Aphanizomenon_spp (2) ROIs
ifcb_create_manual_file(roi_length = 100,
class2use = c("unclassified", "Aphanizomenon_spp"),
output_file = "output.mat",
classlist = c(rep(1, 50), rep(2, 50)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.