Use expression with a variable r

后端 未结 4 1221
我寻月下人不归
我寻月下人不归 2020-12-13 06:23

I am trying to label a plot with the following label:

\"Some Assay EC50 (uM)\" where the \"u\" is a micro symbol.

I currently have:

assay &l         


        
4条回答
  •  遥遥无期
    2020-12-13 07:18

    Using tidy_eval approach you could do

    library(rlang)
    
    assay <- "Some Assay"
    plot(0,xlab=expr(paste(!!assay," AC50 (",mu,"M)",sep="")))
    

    expr and !! are included in tidyverse, so you don't actually need to load rlang. I just put it there to be explicit about where they come from.

提交回复
热议问题