You obviously never want to share on an internet forum people's private medical data, but do you have a dummy bit of code for folks to work with? Ideally in the form of a reproducible example (FAQ: What's a reproducible example (`reprex`) and how do I do one?).
Also, do you have a specific method you're looking to implement in R? e.g. propensity score matching or something? Depending on what you're trying to do, there's likely an R package designed to help.