Я работаю с этим фреймом данных
structure(list(src_subject_id = c(19039L, 19040L, 19041L, 19042L,
19043L, 19046L), interview_date = c("1/9/20", "9/4/19", "6/12/19",
"6/17/19", "9/7/19", "11/27/19"), gender = c("F", "F", "F", "F",
"F", "F"), interview_age = c("14", "13", "14", "13", "13", "13"
), MDDPast = c(1L, 1L, 1L, 1L, 1L, 1L), MDDCurrent = c(1L, 1L,
1L, 1L, 1L, 1L), DysthymiaPast = c(1L, 1L, 1L, 1L, 1L, 1L), DysthymiaCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), DepNOSPast = c(1L, 1L, 1L, 1L, 1L, 1L),
DepNOSCurrent = c(1L, 1L, 1L, 1L, 1L, 1L), CyclothymiaPast = c(1L,
1L, 1L, 1L, 1L, 1L), CyclothymiaCurrent = c(1L, 1L, 1L, 1L,
1L, 1L), BipolarNOSPast = c(1L, 1L, 1L, 1L, 1L, 1L), BipolarNOSCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), BipolarIPast = c(1L, 1L, 1L, 1L, 1L,
1L), BipolarICurrent = c(1L, 1L, 1L, 1L, 1L, 1L), BipolarIIPast = c(1L,
1L, 1L, 1L, 1L, 1L), BipolarIICurrent = c(1L, 1L, 1L, 1L,
1L, 1L), PsychoticFeaturesPast = c(1L, 1L, 1L, 1L, 1L, 1L
), PsychoticFeaturesCurrent = c(1L, 1L, 1L, 1L, 1L, 1L),
PanicDisorderPast = c(1L, 1L, 1L, 1L, 1L, 1L), PanicDisorderCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), SeparationPast = c(1L, 1L, 1L, 1L, 1L,
1L), SeparationCurrent = c(1L, 1L, 1L, 1L, 1L, 1L), ParentChildRelationalPast = c(1L,
1L, 1L, 1L, 1L, 1L), ParentChildRelationalCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), SimplePhobiaPast = c(1L, 1L, 1L, 1L,
1L, 1L), SimplePhobiaCurrent = c(1L, 1L, 1L, 1L, 1L, 1L),
SocialPhobiaPast = c(1L, 1L, 1L, 1L, 1L, 1L), SocialPhobiaCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), AgoraphobiaPast = c(1L, 1L, 1L, 1L,
1L, 1L), AgoraphobiaCurrent = c(1L, 1L, 1L, 1L, 1L, 1L),
AdjustmentDisorderPast = c(1L, 1L, 1L, 1L, 1L, 1L), AdjustmentDisorderCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), GADPast = c(1L, 1L, 3L, 1L, 1L, 1L),
GADCurrent = c(1L, 1L, 1L, 1L, 1L, 1L), OCDPast = c(1L, 1L,
1L, 1L, 1L, 1L), OCDCurrent = c(1L, 1L, 1L, 1L, 1L, 1L),
PTSDPast = c(1L, 1L, 1L, 1L, 1L, 1L), PTSDCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), AnxietyNOSPast = c(1L, 4L, 1L, 1L, 1L,
1L), AnxietyNOSCurrent = c(1L, 1L, 1L, 1L, 1L, 1L), ADHDPast = c(1L,
1L, 1L, 1L, 1L, 1L), ADHDCurrent = c(1L, 1L, 1L, 1L, 3L,
1L), ODDPast = c(1L, 1L, 1L, 1L, 1L, 1L), ODDCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), ConductPast = c(1L, 1L, 3L, 1L, 1L,
1L), ConductCurrent = c(1L, 1L, 1L, 1L, 1L, 1L), DisruptiveBehPast = c(1L,
1L, 1L, 1L, 1L, 1L), DisruptiveBehCurrent = c(1L, 1L, 1L,
1L, 1L, 1L), AnorexiaPast = c(1L, 4L, 1L, 3L, 1L, 1L), AnorexiaCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), BulimiaPast = c(1L, 3L, 1L, 1L, 4L,
1L), BulimiaCurrent = c(1L, 1L, 1L, 1L, 1L, 4L), EatingNOSPast = c(1L,
1L, 1L, 1L, 1L, 1L), EatingNOSCurrent = c(1L, 1L, 1L, 1L,
1L, 1L), NicotinePast = c(1L, 1L, 1L, 3L, 1L, 1L), NicotineCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), AlcoholAbusePast = c(1L, 4L, 1L, 1L,
1L, 1L), AlcoholAbuseCurrent = c(1L, 1L, 1L, 3L, 1L, 1L),
AlcoholDependencePast = c(1L, 1L, 1L, 1L, 1L, 1L), AlcoholDependenceCurrent = c(1L,
1L, 1L, 1L, 1L, 1L), SubstanceAbusePast = c(1L, 3L, 1L, 1L,
1L, 1L), SubstanceAbuseCurrent = c(1L, 1L, 1L, 1L, 1L, 1L
), SubstanceDependencePast = c(1L, 1L, 1L, 4L, 1L, 3L), SubstanceDependenceCurrent = c(1L,
1L, 1L, 1L, 1L, 1L)), row.names = c(NA, 6L), class = "data.frame")
Назовите его fuKSADS_1. Я пытаюсь сделать fuKSADS_1_currentdx с помощью фильтрации, чтобы включить только значения 3 или 4. Я делаю это с помощью функции filter_all:
fuKSADS_1_currentdx <- filter_all(fuKSADS_1, vars(ends_with('Current')), .vars_predicate = any_vars(.>2))
Где я пытаюсь найти только текущие диагнозы и отфильтровать любые значения больше 2. Я думаю, что я не обязательно поступаю правильно, но это та строка кода, которая у меня есть прямо сейчас. С тем, что я написал, я только что вернул фрейм данных с именем fuKSADS_1_currentdx, который в точности совпадает с fuKSADS_1. Не совсем уверен, откуда у меня проблема.