This file is indexed.

/usr/share/doc/r-cran-phangorn/tests/testthat/test_pmlPen.R is in r-cran-phangorn 2.4.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
28
29
context("penalized likelihood")

X <- allSitePattern(5)
attr(X, "index") <- NULL
tree1 <- read.tree(text = "((t1:0.1,t2:0.5):0.1,(t3:0.1,t4:0.5):0.1,t5:0.5);")
tree2 <- read.tree(text = "((t1:0.5,t2:0.1):0.1,(t3:0.5,t4:0.1):0.1,t5:0.5);")

fit1 <- pml(tree1,X)
fit2 <- pml(tree2,X)

attr(X, "weight") <- 1000*exp(fit1$site)
Y <- X
attr(Y, "weight") <- 1000*exp(fit2$site)

fit1 <- update(fit1, data=X)
fit2 <- update(fit2, data=Y)

sp <- pmlPart(~ edge, list(fit1, fit2))
pp0 <- pmlPen(sp, lambda = 0, pml.control(trace = 0))
ppInf <- pmlPen(sp, lambda = 1e6, pml.control(trace = 0))

Z <- cbind(X,Y)
fit3 <- update(fit1, data=Z)
fit3 <- optim.pml(fit3, control = pml.control(trace = 0))

test_that("penalized partition models work as expected", {
    expect_equal(pp0$logLik[1], fit1$logLik + fit2$logLik) #, tolerance = 0.002) 
    expect_equal(ppInf$logLik[1], fit3$logLik, tolerance = 1e-5)
})