Use a variable name with spaces inline in R markdown

前端 未结 1 1241
离开以前
离开以前 2021-01-12 08:49

How can I include inline R code that refers to a variable name that contains spaces or other unusual characters (actual use-case is Pr(>F))? Bac

1条回答
  •  醉梦人生
    2021-01-12 09:04

    In this instance can use normal quotes,

     The first five values of your data are `r df$"your data"[1:5]`
    

    or rather

     The first five values of your data are `r df[["your data"]][1:5]`
    

    0 讨论(0)
提交回复
热议问题