@@ -434,10 +434,10 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
434
434
selector_list = selector_list ,
435
435
datasets = data
436
436
)
437
-
437
+ qenv <- teal.code :: eval_code(data(), ' library("ggplot2");library("dplyr");library("tidyr") ' ) # nolint quotes
438
438
anl_merged_q <- reactive({
439
439
req(anl_merged_input())
440
- data() %> %
440
+ qenv %> %
441
441
teal.code :: eval_code(as.expression(anl_merged_input()$ expr ))
442
442
})
443
443
@@ -581,12 +581,12 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
581
581
theme = list (
582
582
legend.position = " right" ,
583
583
legend.spacing.y = quote(grid :: unit(- 5 , " pt" )),
584
- legend.title = quote(element_text(vjust = 25 )),
584
+ legend.title = quote(ggplot2 :: element_text(vjust = 25 )),
585
585
axis.text.x = substitute(
586
- element_text(angle = angle_value , hjust = hjust_value ),
586
+ ggplot2 :: element_text(angle = angle_value , hjust = hjust_value ),
587
587
list (angle_value = angle_value , hjust_value = hjust_value )
588
588
),
589
- text = substitute(element_text(size = font_size ), list (font_size = font_size ))
589
+ text = substitute(ggplot2 :: element_text(size = font_size ), list (font_size = font_size ))
590
590
)
591
591
)
592
592
@@ -611,24 +611,24 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
611
611
)
612
612
613
613
cols <- c(getOption(" ggplot2.discrete.colour" ), c(" lightblue" , " darkred" , " black" ))[1 : 3 ]
614
- elbow_plot <- ggplot(mapping = aes_string(x = " component" , y = " value" )) +
615
- geom_bar(
616
- aes(fill = " Single variance" ),
614
+ elbow_plot <- ggplot2 :: ggplot(mapping = aes_string(x = " component" , y = " value" )) +
615
+ ggplot2 :: geom_bar(
616
+ ggplot2 :: aes(fill = " Single variance" ),
617
617
data = dplyr :: filter(elb_dat , metric == " Proportion of Variance" ),
618
618
color = " black" ,
619
619
stat = " identity"
620
620
) +
621
- geom_point(
622
- aes(color = " Cumulative variance" ),
621
+ ggplot2 :: geom_point(
622
+ ggplot2 :: aes(color = " Cumulative variance" ),
623
623
data = dplyr :: filter(elb_dat , metric == " Cumulative Proportion" )
624
624
) +
625
- geom_line(
626
- aes(group = 1 , color = " Cumulative variance" ),
625
+ ggplot2 :: geom_line(
626
+ ggplot2 :: aes(group = 1 , color = " Cumulative variance" ),
627
627
data = dplyr :: filter(elb_dat , metric == " Cumulative Proportion" )
628
628
) +
629
629
labs +
630
- scale_color_manual(values = c(" Cumulative variance" = cols [2 ], " Single variance" = cols [3 ])) +
631
- scale_fill_manual(values = c(" Cumulative variance" = cols [2 ], " Single variance" = cols [1 ])) +
630
+ ggplot2 :: scale_color_manual(values = c(" Cumulative variance" = cols [2 ], " Single variance" = cols [3 ])) +
631
+ ggplot2 :: scale_fill_manual(values = c(" Cumulative variance" = cols [2 ], " Single variance" = cols [1 ])) +
632
632
ggthemes +
633
633
themes
634
634
},
@@ -656,9 +656,9 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
656
656
657
657
dev_ggplot2_args <- teal.widgets :: ggplot2_args(
658
658
theme = list (
659
- text = substitute(element_text(size = font_size ), list (font_size = font_size )),
659
+ text = substitute(ggplot2 :: element_text(size = font_size ), list (font_size = font_size )),
660
660
axis.text.x = substitute(
661
- element_text(angle = angle_val , hjust = hjust_val ),
661
+ ggplot2 :: element_text(angle = angle_val , hjust = hjust_val ),
662
662
list (angle_val = angle , hjust_val = hjust )
663
663
)
664
664
)
@@ -688,15 +688,15 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
688
688
y = sin(seq(0 , 2 * pi , length.out = 100 ))
689
689
)
690
690
691
- circle_plot <- ggplot(pca_rot ) +
692
- geom_point(aes_string(x = x_axis , y = y_axis )) +
693
- geom_label(
694
- aes_string(x = x_axis , y = y_axis , label = " label" ),
691
+ circle_plot <- ggplot2 :: ggplot(pca_rot ) +
692
+ ggplot2 :: geom_point(ggplot2 :: aes_string(x = x_axis , y = y_axis )) +
693
+ ggplot2 :: geom_label(
694
+ ggplot2 :: aes_string(x = x_axis , y = y_axis , label = " label" ),
695
695
nudge_x = 0.1 , nudge_y = 0.05 ,
696
696
fontface = " bold"
697
697
) +
698
- geom_path(aes(x , y , group = 1 ), data = circle_data ) +
699
- geom_point(aes(x = x , y = y ), data = data.frame (x = 0 , y = 0 ), shape = " x" , size = 5 ) +
698
+ ggplot2 :: geom_path(ggplot2 :: aes(x , y , group = 1 ), data = circle_data ) +
699
+ ggplot2 :: geom_point(ggplot2 :: aes(x = x , y = y ), data = data.frame (x = 0 , y = 0 ), shape = " x" , size = 5 ) +
700
700
labs +
701
701
ggthemes +
702
702
themes
@@ -790,7 +790,9 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
790
790
pca_plot_biplot_expr <- c(
791
791
pca_plot_biplot_expr ,
792
792
substitute(
793
- geom_point(aes_string(x = x_axis , y = y_axis ), data = pca_rot , alpha = alpha , size = size ),
793
+ ggplot2 :: geom_point(ggplot2 :: aes_string(x = x_axis , y = y_axis ),
794
+ data = pca_rot , alpha = alpha , size = size
795
+ ),
794
796
list (x_axis = input $ x_axis , y_axis = input $ y_axis , alpha = input $ alpha , size = input $ size )
795
797
)
796
798
)
@@ -801,7 +803,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
801
803
response <- ANL [[resp_col ]]
802
804
803
805
aes_biplot <- substitute(
804
- aes_string(x = x_axis , y = y_axis , color = " response" ),
806
+ ggplot2 :: aes_string(x = x_axis , y = y_axis , color = " response" ),
805
807
env = list (x_axis = x_axis , y_axis = y_axis )
806
808
)
807
809
@@ -822,15 +824,15 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
822
824
qenv ,
823
825
quote(pca_rot $ response <- as.factor(response ))
824
826
)
825
- quote(scale_color_brewer(palette = " Dark2" ))
827
+ quote(ggplot2 :: scale_color_brewer(palette = " Dark2" ))
826
828
} else if (inherits(response , " Date" )) {
827
829
qenv <- teal.code :: eval_code(
828
830
qenv ,
829
831
quote(pca_rot $ response <- numeric (response ))
830
832
)
831
833
832
834
quote(
833
- scale_color_gradient(
835
+ ggplot2 :: scale_color_gradient(
834
836
low = c(getOption(" ggplot2.discrete.colour" )[2 ], " darkred" )[1 ],
835
837
high = c(getOption(" ggplot2.discrete.colour" ), " lightblue" )[1 ],
836
838
labels = function (x ) as.Date(x , origin = " 1970-01-01" )
@@ -841,7 +843,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
841
843
qenv ,
842
844
quote(pca_rot $ response <- response )
843
845
)
844
- quote(scale_color_gradient(
846
+ quote(ggplot2 :: scale_color_gradient(
845
847
low = c(getOption(" ggplot2.discrete.colour" )[2 ], " darkred" )[1 ],
846
848
high = c(getOption(" ggplot2.discrete.colour" ), " lightblue" )[1 ]
847
849
))
@@ -850,7 +852,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
850
852
pca_plot_biplot_expr <- c(
851
853
pca_plot_biplot_expr ,
852
854
substitute(
853
- geom_point(aes_biplot , data = pca_rot , alpha = alpha , size = size ),
855
+ ggplot2 :: geom_point(aes_biplot , data = pca_rot , alpha = alpha , size = size ),
854
856
env = list (aes_biplot = aes_biplot , alpha = alpha , size = size )
855
857
),
856
858
scales_biplot
@@ -861,17 +863,17 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
861
863
pca_plot_biplot_expr <- c(
862
864
pca_plot_biplot_expr ,
863
865
substitute(
864
- geom_segment(
865
- aes_string(x = " xstart" , y = " ystart" , xend = x_axis , yend = y_axis ),
866
+ ggplot2 :: geom_segment(
867
+ ggplot2 :: aes_string(x = " xstart" , y = " ystart" , xend = x_axis , yend = y_axis ),
866
868
data = rot_vars ,
867
869
lineend = " round" , linejoin = " round" ,
868
870
arrow = grid :: arrow(length = grid :: unit(0.5 , " cm" ))
869
871
),
870
872
env = list (x_axis = x_axis , y_axis = y_axis )
871
873
),
872
874
substitute(
873
- geom_label(
874
- aes_string(
875
+ ggplot2 :: geom_label(
876
+ ggplot2 :: aes_string(
875
877
x = x_axis ,
876
878
y = y_axis ,
877
879
label = " label"
@@ -882,7 +884,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
882
884
),
883
885
env = list (x_axis = x_axis , y_axis = y_axis )
884
886
),
885
- quote(geom_point(aes(x = xstart , y = ystart ), data = rot_vars , shape = " x" , size = 5 ))
887
+ quote(ggplot2 :: geom_point(ggplot2 :: aes(x = xstart , y = ystart ), data = rot_vars , shape = " x" , size = 5 ))
886
888
)
887
889
}
888
890
@@ -892,9 +894,9 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
892
894
dev_ggplot2_args <- teal.widgets :: ggplot2_args(
893
895
labs = dev_labs ,
894
896
theme = list (
895
- text = substitute(element_text(size = font_size ), list (font_size = font_size )),
897
+ text = substitute(ggplot2 :: element_text(size = font_size ), list (font_size = font_size )),
896
898
axis.text.x = substitute(
897
- element_text(angle = angle_val , hjust = hjust_val ),
899
+ ggplot2 :: element_text(angle = angle_val , hjust = hjust_val ),
898
900
list (angle_val = angle , hjust_val = hjust )
899
901
)
900
902
)
@@ -942,9 +944,9 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
942
944
943
945
dev_ggplot2_args <- teal.widgets :: ggplot2_args(
944
946
theme = list (
945
- text = substitute(element_text(size = font_size ), list (font_size = font_size )),
947
+ text = substitute(ggplot2 :: element_text(size = font_size ), list (font_size = font_size )),
946
948
axis.text.x = substitute(
947
- element_text(angle = angle_val , hjust = hjust_val ),
949
+ ggplot2 :: element_text(angle = angle_val , hjust = hjust_val ),
948
950
list (angle_val = angle , hjust_val = hjust )
949
951
)
950
952
)
@@ -965,17 +967,17 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
965
967
list (
966
968
quote(ggplot(pca_rot )),
967
969
substitute(
968
- geom_bar(
969
- aes_string(x = " Variable" , y = pc ),
970
+ ggplot2 :: geom_bar(
971
+ ggplot2 :: aes_string(x = " Variable" , y = pc ),
970
972
stat = " identity" ,
971
973
color = " black" ,
972
974
fill = c(getOption(" ggplot2.discrete.colour" ), " lightblue" )[1 ]
973
975
),
974
976
env = list (pc = pc )
975
977
),
976
978
substitute(
977
- geom_text(
978
- aes(
979
+ ggplot2 :: geom_text(
980
+ ggplot2 :: aes(
979
981
x = Variable ,
980
982
y = pc_name ,
981
983
label = round(pc_name , 3 ),
0 commit comments