EcoGenetics (version 1.2.1-5)

ecogen2gstudio: Conversion from ecogen to gstudio and gstudio to ecogen

Description

These functions converts the genetic data of an ecogen object in a gstudio data frame or viceversa.

Conversion from gstudio to ecogen

Usage

ecogen2gstudio(from, type = c("codominant", "dominant"))

gstudio2ecogen(from, ID = "ID", lat = "Latitude", lon = "Longitude", struct = NULL)

Arguments

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)

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
data(eco.test)
togstudio <- ecogen2gstudio(eco, type = "codominant")
togstudio
toeco <- gstudio2ecogen(togstudio, ID = "ID", lat = "Latitude", 
lon = "Longitude", 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
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace