【发布时间】:2020-05-11 16:49:05
【问题描述】:
我在 RMarkdown 中遇到错误。
Quitting from lines 23-54 (Report_Preliminary.Rmd)
Error in UseMethod("select_") :
no applicable method for 'select_' applied to an object of class "function"
Calls: <Anonymous> ... <Anonymous> -> <Anonymous> -> select.default -> select_
Execution halted
这是我正在尝试运行的代码
data_select <- data %>%
dplyr::select(ID, Age, Gender, Location, Country, Chills, Cough, Diarrhoea, Fatigue, Headcahe, 'Healthcare Worker', 'How Unwell',
'Long Standing Health Issues', 'Loss of smell and taste', 'Muscle Ache', 'Nasal Congestion', 'Nausea and Vomiting',
'Number Of Days Symptoms Showing',
'Pregnant', 'Self Diagnosis', 'Shortness of Breath', 'Sore Throat','Reason For Helping', 'Sputum', 'Temperature') %>%
dplyr::rename( id = ID,
age = Age,
gender = Gender,
location = Location,
country = Country,
chills = Chills,
diarrhoea = Diarrhoea,
fatigue = Fatigue,
headache = Headcahe,
healthcare_worker = 'Healthcare Worker',
how_unwell = 'How Unwell',
long_standing_health = 'Long Standing Health Issues',
loss_smell_taste = 'Loss of smell and taste',
muscle_ache = 'Muscle Ache',
nasal_congestion = 'Nasal Congestion',
nausea_vomiting = 'Nausea and Vomiting',
no_days_symptoms_show = 'Number Of Days Symptoms Showing',
pregnant = 'Pregnant',
shortness_breath = 'Shortness of Breath',
sore_throat = 'Sore Throat',
sputum = 'Sputum',
temperature = 'Temperature',
self_diagnosis = 'Self Diagnosis',
tested_or_not = 'Reason For Helping')
然而,当我在 Rmarkdown 中运行每个块时,我完全没有问题。我得到了需要的输出。 其他人对此有任何问题吗?
【问题讨论】:
-
如果没有最低限度的可重现代码,很难帮助你,你能提供吗?
-
Jrm_FRL 我可以,但究竟是什么?既然我认为这就足够了?您指的是整个脚本吗?
-
请提供您的数据样本!
-
很抱歉,我不能,因为这是机密工作……我只能说这是一个 Rmarkdown 问题,因为我的块中的功能可以完美运行。
标签: r select r-markdown tidyverse