У меня есть список (в рамках данных) строк.У меня также есть список (такого же размера, как список в кадре данных) с номерами, соответствующими индексам.Я хотел бы извлечь те элементы в первом списке, которые соответствуют целым числам во втором списке.
Вот мои синтетически сгенерированные данные
columnSentence<-list(c(",", ",Biopsies taken from top of stricture-metal marking clips in situ.",
",Diaphragmatic pinch:40cm .,She has a small hiatus hernia .",
"Dr. Martin, Marche Date of procedure: 2009-11-11 Endoscopist:",
"Dr. Sullivan, Shelby Second endoscopist: Dr. al-Basha, Mahfoodha Medications:",
"Extent of Exam: GOJ Indications: Follow-up ULCER HEALING Procedure Performed: Gastroscopy (OGD) Findings:",
"Fentanyl 12.5mcg Midazolam 6mg Instrument: FG5", "HALO 90 done with good effect Endoscopic Diagnosis:",
"He is on Barrett's Screeling List in October 2017 at St Thomas'.",
"Hospital: Random NHS Foundation Trust Hospital Number: J6044658",
"No evidence of Barrett's oesophagus, short 2 cn hiatus hernia.",
",Oesophageal biopsies taken from three levels as requested.",
",OGD today to assess for ulceration/ongoing bleeding.", "Patient Name: Jargon, Victoria General Practitioner:",
"Post chemo-radiotherapy stricture", ",The varices flattened well with air insufflation.",
"Tiny erosions at the antrum.", "We will re-book for 2 weeks, rebanding."
), c("Date of procedure: 2008-06-15 Endoscopist:", "Dr. al-Safi, Lutfiyya",
"Dr. Kekich, Annabelle Second endoscopist: Dr. Needham, April Medications:",
"Duodenitis with a small erosion .", "Endoscopic Diagnosis:",
"Esophageal candidiasis", "Extent of Exam: Pylorus Indications: Weight Loss Procedure Performed: Gastroscopy (OGD) Findings: Duodenum:",
"Fentanyl 125mcg Midazolam 7mg Instrument: FG6", "Hospital: Random NHS Foundation Trust Hospital Number: Y6417773 Patient Name: Powell, Destiny General Practitioner:",
",STOMACH: diffuse gastritis with angiodysplasia and punctate bleeding site on greater curve mid body - no obvious ulcer- antrum scar ?,No immediate complications.",
",Z-line at: 38cm - Bravo placed at 32cm- good positionat check endoscopy."
), c("Body Polyp- Pedunculated .,Several erosions/small ulcers in inflammed antrum.",
"Date of procedure: 2007-10-27 Endoscopist:", "Dr. Rogers, Monica",
"Dr. Sullivan, Shelby Second endoscopist: Dr. al-Basha, Mahfoodha Medications:",
",DUODENUM: Normal to D3.", "Endoscopic Diagnosis:", "Extent of Exam: GOJ Indications: Follow-up ULCER HEALING Procedure Performed: Gastroscopy (OGD) Findings:",
"Fentanyl 125mcg Midazolam 6mg Instrument: FG2", "Hospital: Random NHS Foundation Trust Hospital Number: B6072011",
",Lax cardia with small hiatus hernia but no erosive oesophagitis.",
"Patient Name: Martinez-Santos, Ana General Practitioner:", "Post chemo-radiotherapy stricture ,Extensive neoplastic looking esophageal lesion Esophageal candidiasis",
"Stomach-"))
Список индексов:
myIndexes<-list(c(2L, 4L), 1L, 2L)
Как извлечь предложения, соответствующие списку myIndexes
?