Skip to content

Commit cc09438

Browse files
committed
A few more tests added to coerce
1 parent 55f729e commit cc09438

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

inst/tests/coerce.R

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
.test <- "X data frame, y factor"
12
data(heart)
23
X <- heart[,1:9]
34
y <- factor(heart$chd, labels=c("No", "Yes"))
45
fit <- ncvreg(X, y, family="binomial")
5-
std(X)
6+
s <- std(X)
7+
8+
.test <- "integer X, y"
9+
X <- as.matrix(round(X))
10+
storage.mode(X) <- "integer"
11+
y <- heart$chd
12+
fit <- ncvreg(X, y, family="binomial")
13+
14+
.test <- "logical y"
15+
y <- heart$chd==1
16+
fit <- ncvreg(X, y, family="binomial")

0 commit comments

Comments
 (0)