These functions converts the genetic data of an ecogen object in a gstudio data frame or viceversa.
Conversion from gstudio to ecogen
ecogen2gstudio(from, type = c("codominant", "dominant")) gstudio2ecogen(from, ID = "ID", lat = "Latitude", lon = "Longitude", struct = NULL)
from | Input object of class "ecogen" or "gstudio" (depending the direction of conversion) |
---|---|
type | The type of data: "codominant" (for codominant data); "dominant" for presence - absence data. |
ID | name of the column with ID (default "ID") |
lat | name of the column with latitude (default "Latitude") |
lon | name of the column with longitude (default "Longitude") |
struct | vector with name of the columns with structures (default NULL) |
# NOT RUN { data(eco.test) togstudio <- ecogen2gstudio(eco, type = "codominant") togstudio toeco <- gstudio2ecogen(togstudio, ID = "ID", lat = "Latitude", lon = "Longitude", ID = "ID", struct = "pop") toeco # as ID, Latitude and Longitude are column names in the <togstudio> data frame # (that match default parameter values for gstudio2ecogen), # the latter is identical to this: toeco <- gstudio2ecogen(togstudio, struct = "pop") toeco # }