Learn R Programming

LEA (version 1.4.0)

write.env: Write files in the env format

Description

Write a file in the env format.

Usage

write.env(R, output.file)

Arguments

R
A matrix containing the environmental variables with one line for each individual and one column for each environmental variable. The missing genotypes have to be encoded with the value 9.
output.file
A character string containing a path to the output file, an environmental data matrix in the env formt.

Value

output.file
A character string containing a path to the output file, an environmental data matrix in the env formt.

See Also

read.env env lfmm

Examples

Run this code
# Creation of an environmental matrix C 
# containing 2 environmental variables for 3 individuals.
# C contains one line for each individual and one column for each variable.
C = matrix(runif(6), ncol=2, nrow=3)

# Write C in a file called "tuto.env".
# Create file:    "tuto.env".
write.env(C,"tuto.env")

# Read the file "tuto.env".
C = read.env("tuto.env")

Run the code above in your browser using DataLab