Skip to content

Commit b075255

Browse files
committed
Fixing docstring and NAMESPACE glitches
1 parent eb8c648 commit b075255

9 files changed

Lines changed: 30 additions & 11 deletions

File tree

NAMESPACE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ S3method(na.omit,comparative.data)
1515
S3method(nobs,pgls)
1616
S3method(plot,caic)
1717
S3method(plot,fusco)
18+
S3method(plot,pgls)
1819
S3method(plot,pgls.profile)
1920
S3method(plot,phylo.d)
2021
S3method(predict,caic)
@@ -43,14 +44,18 @@ export(caic.robust)
4344
export(caic.table)
4445
export(clade.matrix)
4546
export(clade.members)
47+
export(clade.members.list)
4648
export(comparative.data)
4749
export(crunch)
50+
export(ed.calc)
4851
export(fusco.test)
4952
export(growTree)
5053
export(macrocaic)
54+
export(pd.bootstrap)
5155
export(pd.calc)
5256
export(pgls)
5357
export(pgls.confint)
58+
export(pgls.profile)
5459
export(phylo.d)
5560
export(phylo.d.subset)
5661
importFrom(stats,na.omit)

R/clade.members.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
#'
3232
#' data(perissodactyla)
3333
#' # use comparative.data to add node labels
34-
#' perisso <- comparative.data(perissodactyla.tree, perissodactyla.data, Binomial, na.omit = FALSE)
34+
#' perisso <- comparative.data(
35+
#' perissodactyla.tree, perissodactyla.data, Binomial,
36+
#' na.omit = FALSE
37+
#' )
3538
#' plot(perisso$phy, show.node.label = TRUE)
3639
#' clade.members(22, perisso$phy, tip.labels = TRUE)
3740
#' clade.members.list(perisso$phy, tip.labels = FALSE)
@@ -79,6 +82,8 @@ clade.members <- function(x, phy, tip.labels = FALSE,
7982
return(RET)
8083
}
8184

85+
#' @describeIn clade.members Return clade members of all nodes in a phylogeny
86+
#' @export
8287
clade.members.list <- function(phy, tips = FALSE, tip.labels = FALSE,
8388
include.nodes = FALSE) {
8489
# OLD2NEW CONVERTED

R/macrocaic.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ macrocaic <- function(formula, data, phy, names.col, macroMethod = "RRD",
149149

150150
# Get the model frame including missing data
151151
# and check the number of complete cases in the model frame
152-
initMf <- stats::model.frame(formula, data, na.action = "stats::na.pass")
152+
initMf <- stats::model.frame(formula, data, na.action = stats::na.pass)
153153
initMfComplete <- stats::complete.cases(initMf)
154154
# TODO - think whether this check is always sufficient...
155155
if (sum(initMfComplete) < 2) {

R/pd.calc.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ pd.calc <- function(cm, tip.subset = NULL, method = "TBL", root.edge = FALSE) {
197197
return(RET)
198198
}
199199

200-
200+
#' @describeIn pd.calc Phylogenetic diversity of random subclades
201+
#' @export
201202
pd.bootstrap <- function(cm, ntips, reps = 1000, method = "TBL",
202203
tip.weights = NULL) {
203204
# check we have a valid method
@@ -259,6 +260,8 @@ pd.bootstrap <- function(cm, ntips, reps = 1000, method = "TBL",
259260
return(structure(.Data = pd.store, pd.method = method))
260261
}
261262

263+
#' @describeIn pd.calc Calculation of evolutionary distinctiveness scores
264+
#' @export
262265
ed.calc <- function(cm, polytomy.cf = c("isaac", "mooers", "none")) {
263266
# Nick Isaac, March 2009 + David Orme 2011 takes the phylogeny and returns a
264267
# list containing ED scores of a) species and b) branches the polytomy.cf

R/pgls-methods.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#' @param x An object of class 'pgls'.
2626
#' @param phylo Return phylogenetically corrected residuals or ordinary
2727
#' residuals (see details).
28+
#' @param REML Return the REML estimate of log likelihood - this is not
29+
#' implemented for PGLS models.
2830
#' @param newdata Alternative data for predicting from 'pgls' models.
2931
#' @param digits Number of digits to show in summary methods.
3032
#' @param ... Further arguments to methods.
@@ -202,7 +204,7 @@ coef.pgls <- function(object, ...) {
202204
return(cf)
203205
}
204206

205-
#' @describeIn pgls Extract residuals from a pgls model
207+
#' @describeIn pgls-methods Extract residuals from a pgls model
206208
#' @export
207209
residuals.pgls <- function(object, phylo = FALSE, ...) {
208210
ret <- NULL
@@ -244,6 +246,9 @@ predict.pgls <- function(object, newdata = NULL, ...) {
244246
#' @describeIn pgls-methods Extract the log likelihood from a pgls model
245247
#' @export
246248
logLik.pgls <- function(object, REML = FALSE, ...) {
249+
if (isTRUE(REML)) {
250+
stop("Calculation of REML estimates of logLik not supported for pgls")
251+
}
247252
val <- object$model$log.lik
248253

249254
attr(val, "nall") <- object$n
@@ -283,7 +288,7 @@ nobs.pgls <- function(object, ...) length(stats::resid(object))
283288
#' mod1 <- pgls(log(Egg.Mass) ~ log(M.Mass) * log(F.Mass), shorebird)
284289
#' graphics::par(mfrow = c(2, 2))
285290
#' plot(mod1)
286-
#'
291+
#' @export
287292
plot.pgls <- function(x, ...) {
288293
res <- stats::residuals(x, phylo = TRUE)
289294
res <- res / sqrt(stats::var(res))[1]

R/pgls.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
#' should be reduced to only those variables used in the maximal model in order
112112
#' to avoid prevent redundant variables causing rows to be dropped
113113
#' unnecessarily.
114+
#'
114115
#' @author Rob Freckleton; David Orme
115116
#' @seealso \code{\link{pgls.profile}}, \code{\link{anova.pgls}},
116117
#' \code{\link{summary.pgls}}
@@ -416,7 +417,7 @@ pgls <- function(formula, data, lambda = 1.0, kappa = 1.0, delta = 1.0,
416417
}
417418

418419

419-
420+
#' @describeIn pgls Calcualate the log likelihood of a pgls model
420421
pgls.likelihood <- function(optimPar, fixedPar, y, x, V,
421422
optim.output = TRUE, names.optim = NULL) {
422423
# Full ML estimation for given x and V: modified to also act as an engine
@@ -474,6 +475,7 @@ pgls.likelihood <- function(optimPar, fixedPar, y, x, V,
474475
}
475476
}
476477

478+
#' @describeIn pgls Apply branch length transformations to a VCV matrix
477479
pgls.blenTransform <- function(V, fixedPar) {
478480
## applies the three branch length transformations to a VCV matrix
479481

R/pgls.profile.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
#' mod.l <- pgls.profile(mod, "lambda")
6868
#' plot(mod.l)
6969
#' pgls.confint(mod, "lambda")
70-
#'
70+
#' @export
7171
pgls.profile <- function(pgls, which = c("lambda", "kappa", "delta"),
7272
N = 50, param.CI = NULL) {
7373
## takes a pgls model and profiles one of the branch length transformations

R/phylo.d.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
#' @param permut Number of permutations to be used in the randomisation test.
4848
#' @param rnd.bias An optional name of a variable in \code{data} holding
4949
#' probability weights to bias the generation of the random distribution. See
50-
#' 'destails'
50+
#' 'details'
5151
#' @param x An object of class 'phylo.d'
5252
#' @param object An object of class 'phylo.d'
5353
#' @param bw The bandwidth to be used for the density plots
54-
#' @param list() Further arguments to print and summary methods
54+
#' @param ... Further arguments to print and summary methods
5555
#' @return Returns an object of class 'phylo.d', which is a list of the
5656
#' following:
5757
#'

R/phylo.d.subset.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@
3737
#' @param max.nodes The maximum number of nodes a clade should have for it to
3838
#' have a D value calculated. Defaults to the number of nodes in the whole
3939
#' phylogeny (i.e. no limit).
40-
#' @param x An object of class 'phylo.d.subset'
4140
#' @param object An object of class 'phylo.d.subset'
42-
#' @param list() Further arguments to print and summary methods
41+
#' @param ... Further arguments to print and summary methods
4342
#' @return Returns an object of class 'phylo.d.subset', which is a list of the
4443
#' following:
4544
#'

0 commit comments

Comments
 (0)