lf_structure | R Documentation |
If filenames are consistently named with the same character serating factors, and with every individual including its belonging levels, e.g.:
001_speciesI_siteA_ind1_dorsalview
002_speciesI_siteA_ind2_lateralview
etc., this function returns a data.frame from it that can be passed to Out, Opn, Ldk objects.
lf_structure(lf, names = character(), split = "_", trim.extension = FALSE)
lf |
a list (its names are used, except if it is a list from import_tps
in this case |
names |
the names of the groups, as a vector of characters which length corresponds to the number of groups. |
split |
character, the spliting factor used for the file names. |
trim.extension |
logical. Whether to remove the last for characters in filenames, typically their extension, e.g. '.jpg'. |
The number of groups must be consistent across filenames.
data.frame with, for every individual, the corresponding level for every group.
This is, to my view, a good practice to 'store' the grouping structure in filenames, but it is of course not mandatory.
Note also that you can: i) do a import_jpg and save is a list, say 'foo'; then ii) pass 'names(foo)' to lf_structure. See Momocs' vignette for an illustration.
Note this function will be deprecated from Momocs
when Momacs
and Momit
will be fully operationnal.
import_jpg1, import_Conte, import_txt, lf_structure. See also Momocs' vignettes for data import.
Other babel functions:
tie_jpg_txt()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.