Skip to content

Commit 689a1e8

Browse files
committed
Rd file fixes
1 parent 99454fa commit 689a1e8

5 files changed

Lines changed: 47 additions & 13 deletions

File tree

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Version 1.0.4
2+
3+
Fixes to Rd files picked up by more recent R CMD CHECK runs on CRAN.
4+
15
Version 1.0.3
26

37
Removed outdated details in caper-package documentation

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: caper
22
Type: Package
33
Title: Comparative Analyses of Phylogenetics and Evolution in R
4-
Version: 1.0.3-9000
5-
Date: 2023-09-26
4+
Version: 1.0.4
5+
Date: 2025-08-28
66
Authors@R: c(
77
person('David', 'Orme', email='d.orme@imperial.ac.uk', role=c('aut','cre'),
88
comment=c(ORCID='0000-0002-7005-1394')),

man/comparative.data.Rd

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ caicStyleArgs(phy, data, names.col, warn.dropped=FALSE)
2727
}
2828
%- maybe also 'usage' for other objects documented here.
2929
\arguments{
30-
\item{data}{A data frame containing variables that can be attributed to the taxa at the tips of a phylogeny.}
30+
\item{data}{
31+
A data frame containing variables that can be attributed to the taxa at
32+
the tips of a phylogeny.
33+
}
3134
\item{phy}{A phylogeny (class 'phylo') to be matched to the data above.}
3235
\item{names.col}{The name of a column in the provided data frame that will be used to match data rows to phylogeny tips.}
3336
\item{vcv}{A logical value indicating whether to include a variance covariance array representing the phylogeny within the comparative dataset.}
@@ -40,23 +43,51 @@ caicStyleArgs(phy, data, names.col, warn.dropped=FALSE)
4043
\item{object}{An object of class 'comparative.data'.}
4144
\item{subset}{A logical expression indicating rows of data to keep: missing values are taken as false.}
4245
\item{select}{An expression, indicating columns to select from the data frame.}
43-
\item{order}{One of 'cladewise' or 'pruningwise'. See \code{\link{reorder.phylo}}.}
46+
\item{order}{One of 'cladewise' or 'pruningwise'. See \code{\link[ape]{reorder.phylo}}.}
4447
\item{i,j}{Indices specifying tips or data columns to extract. See details.}
4548
\item{...}{Further arguments to functions.}
4649
}
4750

4851

4952
\details{
50-
The function matches rows in a data frame to tips on a phylogeny and ensures correct ordering of the data with respect to the tips. It also can add a variance covariance representation of the phylogeny. Mismatched rows and tips are removed and the taxon labels of these are stored in the 'dropped' slot of the 'comparative.data' object. The 'print' method displays a brief summary of the dataset contents and the names of the original 'phylo' and 'data.frame' objects. If any rows or tips were dropped, 'print' will also show a venn diagram of the data shared and dropped from each source. Node labels are preserved but must be unique - unlabelled nodes will be assigned numeric codes.
53+
The function matches rows in a data frame to tips on a phylogeny and ensures
54+
correct ordering of the data with respect to the tips. It also can add a
55+
variance covariance representation of the phylogeny. Mismatched rows and tips
56+
are removed and the taxon labels of these are stored in the 'dropped' slot of
57+
the 'comparative.data' object. The 'print' method displays a brief summary of
58+
the dataset contents and the names of the original 'phylo' and 'data.frame'
59+
objects. If any rows or tips were dropped, 'print' will also show a venn diagram
60+
of the data shared and dropped from each source. Node labels are preserved but
61+
must be unique - unlabelled nodes will be assigned numeric codes.
5162

52-
The 'na.omit' and 'subset' methods provide simple ways to clean up and extract parts of the comparative dataset. In particular, 'subset' acts exclusively with the data component of the object and, like subset on a data frame, expects the subset argument to produce a logical vector of data rows to include. The 'reorder' method is use to restructure all the components with the 'comparative.data' object into either pruningwise or cladewise order. This uses code from the 'ape' library: see \code{\link{reorder.phylo}}.
63+
The 'na.omit' and 'subset' methods provide simple ways to clean up and extract
64+
parts of the comparative dataset. In particular, 'subset' acts exclusively with
65+
the data component of the object and, like subset on a data frame, expects the
66+
subset argument to produce a logical vector of data rows to include. The
67+
'reorder' method is use to restructure all the components with the
68+
'comparative.data' object into either pruningwise or cladewise order. This uses
69+
code from the 'ape' library: see \code{\link[ape]{reorder.phylo}}.
5370

54-
The '[' method allows subsets to be taken of the data. There are no replace methods ('[<-'). If only one index is specified (e.g. x[2]), then this is interpreted as extracting data columns from the object. Otherwise (e.g. x[2,], x[1,1]), the first index will specify tips to extract and the second index will specify columns. Indices for tips are permitted to be numeric, logical or character vectors or empty (missing) or NULL. Numeric values are coerced to integer as by as.integer (and hence truncated towards zero). Character vectors will be matched to the names of the object (or for matrices/arrays, the dimnames): see 'Character indices' below for further details.
71+
The '[' method allows subsets to be taken of the data. There are no replace
72+
methods ('[<-'). If only one index is specified (e.g. x[2]), then this is
73+
interpreted as extracting data columns from the object. Otherwise (e.g. x[2,],
74+
x[1,1]), the first index will specify tips to extract and the second index will
75+
specify columns. Indices for tips are permitted to be numeric, logical or
76+
character vectors or empty (missing) or NULL. Numeric values are coerced to
77+
integer as by as.integer (and hence truncated towards zero). Character vectors
78+
will be matched to the names of the object (or for matrices/arrays, the
79+
dimnames): see 'Character indices' below for further details.
5580

56-
The function 'caicStyleArgs' handles turning 'phy', 'data' and 'names.col' arguments into a 'comparative.data' object when they are provided separately to a function. This argument structure was used in older versions of many functions.
81+
The function 'caicStyleArgs' handles turning 'phy', 'data' and 'names.col'
82+
arguments into a 'comparative.data' object when they are provided separately to
83+
a function. This argument structure was used in older versions of many
84+
functions.
5785

58-
All of these functions are in part a substitute for the considerably more sophisticated handling of such data in the package 'phylobase', which will be integrated into later releases.
86+
All of these functions are in part a substitute for the considerably more
87+
sophisticated handling of such data in the package 'phylobase', which will be
88+
integrated into later releases.
5989
}
90+
6091
\value{
6192
A list of class 'comparative.data':
6293
\item{phy}{An object of class 'phylo'}

man/macrocaic.Rd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ macrocaic(formula, data, phy, names.col, macroMethod = "RRD",
2828
The 'macrocaic' function fits a regression to the formula provided using 'crunch' contrasts for continuous explanatory variables and species richness contrasts for the response. The species richness contrasts are either the relative rate difference (RRD) or proportion dominance index (PDI):
2929

3030
\deqn{RRD = \ln\left(\frac{N_1}{N_2}\right)}
31-
{RRD = ln(N_1/N_2)}
3231

3332
\deqn{PDI = \left(\frac{N_1}{N_1+N_2}\right)-0.5}
34-
{PDI = (N_1/(N_1 + N_2))-0.5}
3533

3634
The values \eqn{N_1} and \eqn{N_2} are the species richness of the two daughter nodes and \eqn{N_1} is the species richness of the clade with the larger value of the reference variable. Species richness contrasts are not calculated at polytomies. Nodal values for species richness are calculated as the sum of the richness of the daughter nodes.
3735
}

man/pd.calc.Rd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ There are five implemented PD measures:
3030
\item{Total Branch Length (TBL)}{The sum of all the edge lengths in the subtree given by the tip subset. This measure can be partitioned into the two next measures.}
3131
\item{Shared Branch Length (SBL)}{The sum of all edges in the subtree that are shared by more than one tip.}
3232
\item{Unique Evolutionary History (UEH)}{The sum of the edge lengths that give rise to only one tip in the subtree.}
33-
\item{Length of tip branch lengths (TIPS)}{Length of tip branch lengths (TIPS)}{Unlike UEH, this measure does not use the unique paths to each tips on the \strong{subtree} and instead gives the sum of the unique branches leading to the tips on the \strong{complete tree}.}
34-
\item{Minimum Spanning Tree (MST)}{The sum of the lengths of the edges for the smallest tree that links the subset tips, excluding any edges below the node of the most recent common ancestor.}}
33+
\item{Length of tip branch lengths (TIPS)}{Unlike UEH, this measure does not use the unique paths to each tips on the \strong{subtree} and instead gives the sum of the unique branches leading to the tips on the \strong{complete tree}.}
34+
\item{Minimum Spanning Tree (MST)}{The sum of the lengths of the edges for the smallest tree that links the subset tips, excluding any edges below the node of the most recent common ancestor.}
35+
}
3536

3637
These options are illustrated in the caper package vignette. The pd.calc function returns the PD value for a given set of tips, whereas the pd.bootstrap function returns a vector of PD values for randomly selected sets of tips of a given size.
3738

0 commit comments

Comments
 (0)