Hi
I am having data where the student names and the IDs are given together (separated by "-"). My desired format is the one given in "data2". The names and the IDs are to be in separate columns. An important thing is that there are NAs in the data. And my data is a big one. How can I solve this problem?
library(tidyverse)
data<-tibble::tribble(
~cal_name1, ~cal_name2, ~cal_name3, ~cal_name4, ~cal_name5, ~cal_name6,
"Anand Byahatti-9AHCMX", "Apsana. S Hubballi-R0UQTS", "Fathima Begum.R.Kawalikai-ABUFRY", "Jyothi Byahatti-7I6QJM", "Momadsad Huggi-TFN2GP", "Rajeshwari Dalayatha-AIF3A4",
"Netra S. Kattimani-FAU4EG", "Preeti Salagar-ALWZO7", "Shrikant Jadav-1LAF0L", NA, NA, NA
)
data2<-tibble::tribble(
~cal_name1, ~student1_id, ~cal_name2, ~student2_id, ~cal_name3, ~student3_id, ~cal_name4, ~student4_id, ~cal_name5, ~student5_id, ~cal_name6, ~student6_id,
"Anand Byahatti", "9AHCMX", "Apsana. S Hubballi", "R0UQTS", "Fathima Begum.R.Kawalikai", "ABUFRY", "Jyothi Byahatti", "7I6QJM", "Momadsad Huggi", "TFN2GP", "Rajeshwari Dalayatha", "AIF3A4",
"Netra S. Kattimani", "FAU4EG", "Preeti Salagar", "ALWZO7", "Shrikant Jadav", "1LAF0L", NA, NA, NA, NA, NA, NA
)