[R] Function with large nested list

2023-12-18 Thread Emily Bakker
Hello list, I want to make a large rulebased algorithm, to provide decision support for drug prescriptions. I have defined the algorithm in a function, with a for loop and many if statements. The structure should be as follows: 1. Iterate over a list of drug names. For each drug: 2. Get some dru

[R] Split String in regex while Keeping Delimiter

2023-04-12 Thread Emily Bakker
Hello List,   I have a dataset consisting of strings that I want to split while saving the delimiter.   Some example data: “leucocyten + gramnegatieve staven +++ grampositieve staven ++” “leucocyten – grampositieve coccen +”   I want to split the strings such that I get the following result: c(“le