Hi
I have 3 data frames for students of classes 1,2 and 3. The data is on an assessment survey which tests the students' academic performance. There are a few questions which are common across the three classes/grades. Let's assume a question- "Identification of animals". This question is common across the three grades. the question will be coded as "l1c1_identify_pic1" (for grade 1), "l2c1_identify_pic1" (for grade 2) and "l3c1_identify_pic1" (for grade 3). I want to give a common variable name "lc1". i have given sample data frame "grade1", "grade2" and "grade3". How can I do that?
library(tidyverse)
grade1<-tibble::tribble(
~student_id, ~l1c1_identify_pic1, ~l1c2_color, ~l1c3_shape, ~l1c4_memory,
"S001", 1L, 0L, 1L, 0L,
"S002", 1L, 0L, 0L, 0L,
"S003", 1L, 1L, 0L, 0L,
"S004", 1L, 0L, 0L, 1L,
"S005", 0L, 0L, 1L, 0L,
"S006", 0L, 1L, 0L, 0L,
"S007", 1L, 0L, 1L, 1L,
"S008", 1L, 0L, 0L, 0L,
"S009", 0L, 0L, 0L, 1L,
"S010", 0L, 0L, 0L, 1L
)
garde2<-tibble::tribble(
~student_id, ~l2c1_identify_pic1, ~l2c2_color, ~l2c3_shape, ~l2c4_memory,
"S011", 1L, 0L, 1L, 0L,
"S012", 0L, 1L, 0L, 1L,
"S013", 1L, 1L, 1L, 0L,
"S014", 1L, 1L, 1L, 1L,
"S015", 0L, 0L, 1L, 0L,
"S016", 1L, 1L, 1L, 0L,
"S017", 0L, 0L, 1L, 0L,
"S018", 1L, 1L, 1L, 0L,
"S019", 1L, 1L, 0L, 1L,
"S020", 0L, 1L, 0L, 0L
)
grade3<-tibble::tribble(
~student_id, ~l3c1_identify_pic1, ~l3c2_color, ~l3c3_shape, ~l3c4_memory,
"S021", 1L, 1L, 0L, 1L,
"S022", 1L, 0L, 0L, 1L,
"S023", 1L, 0L, 0L, 1L,
"S024", 0L, 1L, 0L, 0L,
"S025", 1L, 0L, 0L, 0L,
"S026", 1L, 0L, 1L, 1L,
"S027", 0L, 1L, 0L, 1L,
"S028", 1L, 0L, 0L, 1L,
"S029", 0L, 1L, 1L, 1L,
"S030", 0L, 1L, 1L, 0L
)