@@ -434,10 +434,10 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
434434 selector_list = selector_list ,
435435 datasets = data
436436 )
437-
437+ qenv <- teal.code :: eval_code(data(), ' library("ggplot2");library("dplyr");library("tidyr") ' ) # nolint quotes
438438 anl_merged_q <- reactive({
439439 req(anl_merged_input())
440- data() %> %
440+ qenv %> %
441441 teal.code :: eval_code(as.expression(anl_merged_input()$ expr ))
442442 })
443443
@@ -581,12 +581,12 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
581581 theme = list (
582582 legend.position = " right" ,
583583 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 )),
585585 axis.text.x = substitute(
586- element_text(angle = angle_value , hjust = hjust_value ),
586+ ggplot2 :: element_text(angle = angle_value , hjust = hjust_value ),
587587 list (angle_value = angle_value , hjust_value = hjust_value )
588588 ),
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 ))
590590 )
591591 )
592592
@@ -611,24 +611,24 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
611611 )
612612
613613 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" ),
617617 data = dplyr :: filter(elb_dat , metric == " Proportion of Variance" ),
618618 color = " black" ,
619619 stat = " identity"
620620 ) +
621- geom_point(
622- aes(color = " Cumulative variance" ),
621+ ggplot2 :: geom_point(
622+ ggplot2 :: aes(color = " Cumulative variance" ),
623623 data = dplyr :: filter(elb_dat , metric == " Cumulative Proportion" )
624624 ) +
625- geom_line(
626- aes(group = 1 , color = " Cumulative variance" ),
625+ ggplot2 :: geom_line(
626+ ggplot2 :: aes(group = 1 , color = " Cumulative variance" ),
627627 data = dplyr :: filter(elb_dat , metric == " Cumulative Proportion" )
628628 ) +
629629 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 ])) +
632632 ggthemes +
633633 themes
634634 },
@@ -656,9 +656,9 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
656656
657657 dev_ggplot2_args <- teal.widgets :: ggplot2_args(
658658 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 )),
660660 axis.text.x = substitute(
661- element_text(angle = angle_val , hjust = hjust_val ),
661+ ggplot2 :: element_text(angle = angle_val , hjust = hjust_val ),
662662 list (angle_val = angle , hjust_val = hjust )
663663 )
664664 )
@@ -688,15 +688,15 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
688688 y = sin(seq(0 , 2 * pi , length.out = 100 ))
689689 )
690690
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" ),
695695 nudge_x = 0.1 , nudge_y = 0.05 ,
696696 fontface = " bold"
697697 ) +
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 ) +
700700 labs +
701701 ggthemes +
702702 themes
@@ -790,7 +790,9 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
790790 pca_plot_biplot_expr <- c(
791791 pca_plot_biplot_expr ,
792792 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+ ),
794796 list (x_axis = input $ x_axis , y_axis = input $ y_axis , alpha = input $ alpha , size = input $ size )
795797 )
796798 )
@@ -801,7 +803,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
801803 response <- ANL [[resp_col ]]
802804
803805 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" ),
805807 env = list (x_axis = x_axis , y_axis = y_axis )
806808 )
807809
@@ -822,15 +824,15 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
822824 qenv ,
823825 quote(pca_rot $ response <- as.factor(response ))
824826 )
825- quote(scale_color_brewer(palette = " Dark2" ))
827+ quote(ggplot2 :: scale_color_brewer(palette = " Dark2" ))
826828 } else if (inherits(response , " Date" )) {
827829 qenv <- teal.code :: eval_code(
828830 qenv ,
829831 quote(pca_rot $ response <- numeric (response ))
830832 )
831833
832834 quote(
833- scale_color_gradient(
835+ ggplot2 :: scale_color_gradient(
834836 low = c(getOption(" ggplot2.discrete.colour" )[2 ], " darkred" )[1 ],
835837 high = c(getOption(" ggplot2.discrete.colour" ), " lightblue" )[1 ],
836838 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
841843 qenv ,
842844 quote(pca_rot $ response <- response )
843845 )
844- quote(scale_color_gradient(
846+ quote(ggplot2 :: scale_color_gradient(
845847 low = c(getOption(" ggplot2.discrete.colour" )[2 ], " darkred" )[1 ],
846848 high = c(getOption(" ggplot2.discrete.colour" ), " lightblue" )[1 ]
847849 ))
@@ -850,7 +852,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
850852 pca_plot_biplot_expr <- c(
851853 pca_plot_biplot_expr ,
852854 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 ),
854856 env = list (aes_biplot = aes_biplot , alpha = alpha , size = size )
855857 ),
856858 scales_biplot
@@ -861,17 +863,17 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
861863 pca_plot_biplot_expr <- c(
862864 pca_plot_biplot_expr ,
863865 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 ),
866868 data = rot_vars ,
867869 lineend = " round" , linejoin = " round" ,
868870 arrow = grid :: arrow(length = grid :: unit(0.5 , " cm" ))
869871 ),
870872 env = list (x_axis = x_axis , y_axis = y_axis )
871873 ),
872874 substitute(
873- geom_label(
874- aes_string(
875+ ggplot2 :: geom_label(
876+ ggplot2 :: aes_string(
875877 x = x_axis ,
876878 y = y_axis ,
877879 label = " label"
@@ -882,7 +884,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
882884 ),
883885 env = list (x_axis = x_axis , y_axis = y_axis )
884886 ),
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 ))
886888 )
887889 }
888890
@@ -892,9 +894,9 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
892894 dev_ggplot2_args <- teal.widgets :: ggplot2_args(
893895 labs = dev_labs ,
894896 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 )),
896898 axis.text.x = substitute(
897- element_text(angle = angle_val , hjust = hjust_val ),
899+ ggplot2 :: element_text(angle = angle_val , hjust = hjust_val ),
898900 list (angle_val = angle , hjust_val = hjust )
899901 )
900902 )
@@ -942,9 +944,9 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
942944
943945 dev_ggplot2_args <- teal.widgets :: ggplot2_args(
944946 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 )),
946948 axis.text.x = substitute(
947- element_text(angle = angle_val , hjust = hjust_val ),
949+ ggplot2 :: element_text(angle = angle_val , hjust = hjust_val ),
948950 list (angle_val = angle , hjust_val = hjust )
949951 )
950952 )
@@ -965,17 +967,17 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
965967 list (
966968 quote(ggplot(pca_rot )),
967969 substitute(
968- geom_bar(
969- aes_string(x = " Variable" , y = pc ),
970+ ggplot2 :: geom_bar(
971+ ggplot2 :: aes_string(x = " Variable" , y = pc ),
970972 stat = " identity" ,
971973 color = " black" ,
972974 fill = c(getOption(" ggplot2.discrete.colour" ), " lightblue" )[1 ]
973975 ),
974976 env = list (pc = pc )
975977 ),
976978 substitute(
977- geom_text(
978- aes(
979+ ggplot2 :: geom_text(
980+ ggplot2 :: aes(
979981 x = Variable ,
980982 y = pc_name ,
981983 label = round(pc_name , 3 ),
0 commit comments