@@ -16,17 +16,17 @@ test_that("gg_minimal_depth classifications",{
1616 expect_false(is.null(varsel_iris $ md.obj ))
1717
1818 # # Create the correct gg_error object
19- ggrf.obj <- gg_minimal_depth(varsel_iris )
19+ gg_dta <- gg_minimal_depth(varsel_iris )
2020
2121 # Test object type
22- expect_is(ggrf.obj , " gg_minimal_depth" )
22+ expect_is(gg_dta , " gg_minimal_depth" )
2323
2424 # Test varselect is the same
25- expect_equivalent(ggrf.obj $ varselect [,- which(colnames(ggrf.obj $ varselect )== " names" )],
25+ expect_equivalent(gg_dta $ varselect [,- which(colnames(gg_dta $ varselect )== " names" )],
2626 varsel_iris $ varselect )
2727
2828 # # Test plotting the gg_error object
29- gg.obj <- plot.gg_minimal_depth(ggrf.obj )
29+ gg.obj <- plot.gg_minimal_depth(gg_dta )
3030
3131 # Test return is s ggplot object
3232 expect_is(gg.obj , " ggplot" )
@@ -46,17 +46,17 @@ test_that("gg_minimal_depth survival",{
4646 expect_is(varsel_veteran , " list" )
4747
4848 # # Create the correct gg_error object
49- ggrf.obj <- gg_minimal_depth(varsel_veteran )
49+ gg_dta <- gg_minimal_depth(varsel_veteran )
5050
5151 # Test object type
52- expect_is(ggrf.obj , " gg_minimal_depth" )
52+ expect_is(gg_dta , " gg_minimal_depth" )
5353
5454 # Test varselect is the same
55- expect_equivalent(ggrf.obj $ varselect [, - which(colnames(ggrf.obj $ varselect )== " names" )],
55+ expect_equivalent(gg_dta $ varselect [, - which(colnames(gg_dta $ varselect )== " names" )],
5656 varsel_veteran $ varselect )
5757
5858 # # Test plotting the gg_error object
59- gg.obj <- plot.gg_minimal_depth(ggrf.obj )
59+ gg.obj <- plot.gg_minimal_depth(gg_dta )
6060
6161 # Test return is s ggplot object
6262 expect_is(gg.obj , " ggplot" )
@@ -75,17 +75,17 @@ test_that("gg_minimal_depth regression",{
7575 expect_is(varsel_airq , " list" )
7676
7777 # # Create the correct gg_error object
78- ggrf.obj <- gg_minimal_depth(varsel_airq )
78+ gg_dta <- gg_minimal_depth(varsel_airq )
7979
8080 # Test object type
81- expect_is(ggrf.obj , " gg_minimal_depth" )
81+ expect_is(gg_dta , " gg_minimal_depth" )
8282
8383 # Test varselect is the same
84- expect_equivalent(ggrf.obj $ varselect [, - which(colnames(ggrf.obj $ varselect )== " names" )],
84+ expect_equivalent(gg_dta $ varselect [, - which(colnames(gg_dta $ varselect )== " names" )],
8585 varsel_airq $ varselect )
8686
8787 # # Test plotting the gg_error object
88- gg.obj <- plot.gg_minimal_depth(ggrf.obj )
88+ gg.obj <- plot.gg_minimal_depth(gg_dta )
8989
9090 # Test return is s ggplot object
9191 expect_is(gg.obj , " ggplot" )
@@ -97,9 +97,9 @@ test_that("gg_minimal_depth regression",{
9797 expect_is(varsel_Boston , " list" )
9898
9999 # # Create the correct gg_error object
100- ggrf.obj <- gg_minimal_depth(varsel_Boston )
100+ gg_dta <- gg_minimal_depth(varsel_Boston )
101101 # Test object type
102- expect_is(ggrf.obj , " gg_minimal_depth" )
102+ expect_is(gg_dta , " gg_minimal_depth" )
103103
104104 data(Boston , package = " MASS" )
105105
@@ -143,7 +143,7 @@ test_that("gg_minimal_depth regression",{
143143 names(st.labs ) <- names(cls )
144144
145145 # # Test plotting the gg_error object
146- gg.obj <- plot.gg_minimal_depth(ggrf.obj , lbls = st.labs , selection = TRUE )
146+ gg.obj <- plot.gg_minimal_depth(gg_dta , lbls = st.labs , selection = TRUE )
147147
148148 # Test return is s ggplot object
149149 expect_is(gg.obj , " ggplot" )
@@ -180,7 +180,8 @@ test_that("gg_minimal_depth exceptions",{
180180 " minimal depth variable selection" )
181181 expect_is(gg_dta , " gg_minimal_depth" )
182182
183- expect_output(gg_dta <- plot.gg_minimal_depth(rfsrc_airq , fast = TRUE ),
183+ expect_output(gg_plt <- plot.gg_minimal_depth(rfsrc_airq , fast = TRUE ),
184184 " minimal depth variable selection" )
185+ expect_error(gg_minimal_depth(gg_plt ))
185186
186187})
0 commit comments