Would anyone know why I am having trouble selecting certain columns in the function pivot_longer
?
Error:
Backtrace:
- tidyr::pivot_longer(...)
- tidyr:::pivot_longer.data.frame(...)
- tidyr::pivot_longer_spec(...)
Runrlang::last_trace()
to see the full context.
rlang::last_trace()
<error/vctrs_error_ptype2>
Error inpivot_longer_spec()
:
! Can't combinecognitive_testing
andethnic_racial_id
.
df:
code:
df_long <- pivot_longer(df, cols = c(cognitive_testing, person_perception, sexuality, cell_culture, multicultural_counselling, sex_and_gender,
individualism_collectivism, stress_and_conflict, child_development , organizational_culture , body_image,
construct_invariance, miscellaneous, substance_use, mental_health, consumer_behaviour, ethnic_racial_id,
the_self, depth_psychology, identity, marginalised_identities, culture_theory, education, health_service_access,
emotion_concepts), values_to = "index", names_to = "topics")