read.morphodata {MorphoTools2} | R Documentation |
Data Input and Description
Description
This function imports data and produces a morphodata
object from it.
Usage
read.morphodata(file, dec = ".", sep = "\t", ...)
## S3 method for class 'morphodata'
samples(object)
populations(object)
taxa(object)
Arguments
file |
the file which the data are to be read from or a |
dec |
the character used for decimal points. |
sep |
the column separator character. |
object |
an object of class |
... |
further arguments to be passed to |
Details
The function expects the following data structure:
(1) the first row contains variable names;
(2) the following rows contains individuals, single individual per row;
(3) the first three columns include unique identifiers for individuals, populations and taxa/groups, respectively. Columns have to be named as “ID”, “Population” and “Taxon”;
(4) starting from the fourth column, any number of quantitative or binary morphological characters may be recorded. Any variable names can be used (avoiding spaces and special characters);
If there are missing values in the data, they must be represented as empty cells or by the text NA
, not zero, space or any other character. Example dataset in txt and xlsx formats are stored in the “extdata” directory of the MorphoTools2 package installation directory. To find the path to the package location run system.file("extdata", package = "MorphoTools2")
.
Value
an object of class morphodata
with the following elements:
ID |
IDs of each row of |
Population |
population membership of each row of |
Taxon |
taxon membership of each row of |
data |
|
See Also
Examples
data = read.morphodata(file = system.file("extdata", "centaurea.txt",
package = "MorphoTools2"), dec = ".", sep = "\t")
## Not run: data = read.morphodata(file = "morphodata.txt", dec = ".", sep = "\t")
## Not run: data = read.morphodata("clipboard")
summary(data)
samples(data)
populations(data)
taxa(data)