Skip to content

Commit a6a06f2

Browse files
committedJul 19, 2020
Added df_to_mat test
1 parent fcc7b15 commit a6a06f2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎tests/testthat/test_df_to_mat.R

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
context('df_to_mat')
2+
3+
data1 <- data.frame(ID = LETTERS[1:3],
4+
G = c(0,1,1),
5+
H = c(0,0,1),
6+
I = c(1,1,0))
7+
mat1 <- matrix(c(0,1,1,0,0,1,1,1,0),3,3)
8+
rownames(mat1) <- LETTERS[1:3]
9+
colnames(mat1) <- LETTERS[7:9]
10+
11+
test_that("data frame converted to matrix correctly",{
12+
expect_equal(df_to_mat(data1), mat1)
13+
})

0 commit comments

Comments
 (0)
Please sign in to comment.