Learn R Programming

PHYLOGR (version 1.0.11)

read.phylip.data: Read Phylip Infile Data Files

Description

Reads one file with tip data, such as a PHYLIP infile, and returns an R data frame. The files have to follow the PHYLIP standard of having a first line with the number of species and traits. There can be multiple traits, as allowed in PHYLIP. Data for a species can extend over several lines, as for PHYLIP's sequential data format for continuous traits. It is assumed that all traits are cuantitative.

Usage

read.phylip.data(input.phylip.file, variable.names=NULL)

Arguments

input.phylip.file

the name, with path if necessary, of the infile.

variable.names

an optional vector with the new names for the variables.

Value

A data frame (with class phylip.file and data frame) with first column the names of tips and remaining columns the data columns from the phylip file.

References

Diaz-Uriarte, R., and Garland, T., Jr., in prep. PHYLOGR: an R package for the analysis of comparative data via Monte Carlo simulations and generalized least squares approaches.

See Also

read.inp.data, read.pdi.data, read.sim.data,

Examples

Run this code
# NOT RUN {

# }
# NOT RUN {
<!-- %#ifdef unix -->
# }
# NOT RUN {
# This works under both Unix and Windows.
# First need to find out where the ''Examples'' directory is located.
path.to.example <- paste(path.package(package="PHYLOGR"),"Examples/",sep="/") 
# }
# NOT RUN {
<!-- %#endif -->
# }
# NOT RUN {

# }
# NOT RUN {
<!-- %#ifdef windows -->
# }
# NOT RUN {
<!-- % path.to.example <- -->
# }
# NOT RUN {
<!-- %paste(path.package(package="phylog"),"Examples\\",sep="\\") # where the example data sets are -->
# }
# NOT RUN {
<!-- %#endif -->
# }
# NOT RUN {
lacertid.data.name <- paste(path.to.example,"LacertidData.PhylipInfile",sep="")
lacertid.data <- read.phylip.data(lacertid.data.name,variable.names=c("svl", "svl.matur",
                                  "hatsvl", "hatweight", "clutch.size",
                                  "age.mat", "cl.freq", "xx"))
lacertid.data

# You could jump directly to the call to the function if you
# are willing to enter the path explicitly.
# For example in some Linux systems the following works
# read.phylip.data("/usr/lib/R/library/PHYLOGR/Examples/LacertidData.PhylipInfile")
# In Windows, maybe do:
# read.pdi.data("c:\\progra~1\\rw1001\\library\\PHYLOGR\\Examples\\LacertidData.PhylipInfile")

# }

Run the code above in your browser using DataLab