Non-standard evaluation and quasiquotation in dplyr() not working as (naively) expected

前端 未结 2 2095
自闭症患者
自闭症患者 2020-12-11 08:32

I am trying to search a database and then label the ouput with a name derived from the original search, \"derived_name\" in the reproducible example below. I am

2条回答
  •  轮回少年
    2020-12-11 09:02

    So, I've realized that what I was struggling with in this question (and many other probelms) is not really quasiquotation and/or non-standard evaluation, but rather converting character strings into object names. Here is my new solution:

    letrs_top.df <- letrs_count.df %>%
        top_n(5, get(count_colname))
    

提交回复
热议问题