The part of this Shiny code which takes two variables from a df using FancyTable_rows_selected references a dataframe called Expression and generates a scatterplot :
observe({
req(input$fancyTable_rows_selected)
selRow <- myCSV()[input$fancyTable_rows_selected,]
print(selRow[[1]])
output$plot <- renderPlot({
ggplot(Expression, aes_string(x=selRow[[1]], y=selRow[[2]])) +
geom_point(size=2) +
geom_smooth(method=lm, size=2) +
geom_rug(col="darkred", size=0.9, sides="bl", alpha = 0.3) +
theme(aspect.ratio = 1,
axis.title = element_text(size = 15, face = "bold", color = "black"),
axis.text = element_text(size = 12, face = "bold", color = "black"))
})
})
So when I click the rows listing "C1QC" and "C1QB", I get a scatterplot and the labels are printed accordingly :
My question: How do I change this to have the fixed word "Log_Expression" before each printed variable? Such that the printed axes in this case would be "Log_Expression C1QC" and "Log_Expression C1QB" ?
I played around with the labs, xlab and ylab, aes, aes_ and aes_string functions, but I can't seem to make anything work.
Thanks!