@@ -31,23 +31,23 @@ test_that('PCA scores chart returns ggplot object',{
31
31
# apply the model
32
32
M = model.predict(M ,D )
33
33
# chart
34
- C = pca_scores_plot(groups = D $ sample_meta $ Species )
34
+ C = pca_scores_plot(factor_name = ' Species' )
35
35
# plot
36
36
gg = chart.plot(C ,M [2 ])
37
37
38
38
ggplot_build(gg )
39
39
expect_true(is(gg ,' ggplot' ))
40
40
41
41
# label all points
42
- C = pca_scores_plot(groups = D $ sample_meta $ Species ,points_to_label = ' all' )
42
+ C = pca_scores_plot(factor_name = ' Species' ,points_to_label = ' all' )
43
43
# plot
44
44
gg = chart.plot(C ,M [2 ])
45
45
46
46
ggplot_build(gg )
47
47
expect_true(is(gg ,' ggplot' ))
48
48
49
49
# label outliers
50
- C = pca_scores_plot(groups = D $ sample_meta $ Species ,points_to_label = ' outliers' )
50
+ C = pca_scores_plot(factor_name = ' Species' ,points_to_label = ' outliers' )
51
51
# plot
52
52
gg = chart.plot(C ,M [2 ])
53
53
@@ -56,15 +56,16 @@ test_that('PCA scores chart returns ggplot object',{
56
56
57
57
58
58
# continuous factor
59
- C = pca_scores_plot(groups = c(1 : length(D $ sample_meta $ Species )))
59
+ M [2 ]$ scores $ sample_meta $ Sample_No = 1 : length(D $ sample_meta $ Species )
60
+ C = pca_scores_plot(factor_name = ' Sample_No' )
60
61
# plot
61
62
gg = chart.plot(C ,M [2 ])
62
63
63
64
ggplot_build(gg )
64
65
expect_true(is(gg ,' ggplot' ))
65
66
66
67
# label filter
67
- C = pca_scores_plot(groups = D $ sample_meta $ Species ,label_filter = ' virginica' ,points_to_label = ' all' )
68
+ C = pca_scores_plot(factor_name = ' Species' ,label_filter = ' virginica' ,points_to_label = ' all' )
68
69
# plot
69
70
gg = chart.plot(C ,M [2 ])
70
71
@@ -82,21 +83,21 @@ test_that('PCA biplot chart returns ggplot object',{
82
83
# apply the model
83
84
M = model.predict(M ,D )
84
85
# chart
85
- C = pca_biplot_plot(groups = D $ sample_meta $ Species ,style = ' arrows' )
86
+ C = pca_biplot_plot(factor_name = ' Species' ,style = ' arrows' )
86
87
# plot
87
88
gg = chart.plot(C ,M [2 ])
88
89
89
90
ggplot_build(gg )
90
91
expect_true(is(gg ,' ggplot' ))
91
92
# different style
92
- C = pca_biplot_plot(groups = D $ sample_meta $ Species ,style = ' points' )
93
+ C = pca_biplot_plot(factor_name = ' Species' ,style = ' points' )
93
94
# plot
94
95
gg = chart.plot(C ,M [2 ])
95
96
96
97
ggplot_build(gg )
97
98
expect_true(is(gg ,' ggplot' ))
98
99
# variable labels
99
- C = pca_biplot_plot(groups = D $ sample_meta $ Species ,style = ' points' ,label_features = TRUE )
100
+ C = pca_biplot_plot(factor_name = ' Species' ,style = ' points' ,label_features = TRUE )
100
101
# plot
101
102
gg = chart.plot(C ,M [2 ])
102
103
0 commit comments