read.pdi.data: Read Pdi Data Files

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/PHYLOGR.R

Description

Reads one or more pdi data files, such as used by PDTREE, of the PDAP program bundle, and returns an R data frame. Allows to combine several pdi files and to change the name of variables.

Usage

1
read.pdi.data(input.pdi.files, variable.names=NULL)

Arguments

input.pdi.files

the name(s), with path if necessary, of the pdi file(s).

variable.names

an optional vector with the new names for the variables.

Value

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

Author(s)

Diaz-Uriarte, R., and Garland, T., Jr.

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.phylip.data, read.sim.data,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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="/") 








# a simple case
p49a <- paste(path.to.example,"49lbr.pdi",sep="")
data.49a <- read.pdi.data(p49a)
data.49a

# two files and rename columns
p49b <- paste(path.to.example,"49hmt.pdi",sep="")
data.49.2 <- read.pdi.data(c(p49a,p49b),variable.names=c("y","x1","x2","x3"))
data.49.2

# 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.pdi.data("/usr/lib/R/library/PHYLOGR/Examples/49lbr.pdi")
# In Windows, maybe do:
# read.pdi.data("c:\\progra~1\\rw1001\\library\\PHYLOGR\\Examples\\49lbr.pdi")

rdiaz02/PHYLOGR documentation built on April 22, 2020, 11:41 p.m.