View source: R/read.morphodata.R
read.morphodata | R Documentation |
This function imports data and produces a morphodata
object from it.
read.morphodata(file, dec = ".", sep = "\t", ...)
## S3 method for class 'morphodata'
samples(object)
populations(object)
taxa(object)
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 |
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")
.
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 |
|
characters
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.