I would go with
@casbar 's take, more or less. If I already OWNED a 2014, and had 100k+ miles of good service with it, I'd be comfortable running it out to another 50K or so.
But, as mentioned, 2014 was the first model year. Some serious faults were corrected on that year through sometime in 2015. So, I avoided the 2014-2015 altogether, but again, that's mostly personal preference, no one's absolute rule. The "Wetheads" ran from 2014-2018, and there was a transmission mod done in 2017. So, my target (and oh yeah, budget too) moved from to the 2017-2018 range, but anything 2016-2018 should pretty much be bug free. The alternator issue has (as far as I can determine), a rare event, so like any other vehicle, you're assuming risks. Replacing it requires a full engine tear down, since it's mounted internally (I'd like to meet the drunk German engineer to made that little decision for BMW 🙄 I'm sure lubrication and cooling, and the impact on the alternator's performance and lifespan, came into the picture, but still ...). The biggest remaining risk with this model year bike is rocker arm and cams (see attached). It appears BMW didn't actually alter the part with the known material defect until early 2018, even though they knew about it from at least the 2014 model release. (Not happy with that, since my 2018 may have the old parts.)
Again, every bike has it's mechanical strengths and weaknesses. The problem with Beemer owners is that a lot of us are either hobbyists or engineers. As consumers, we know WAY too much, sometimes. I have a 2014 Ford Edge, and being one of those problem owners, I know all about how the water pump is (like the R1200RT's alternator) mounted INTERNALLY in the engine. Any water pump failure generally torches the engine because coolant leaks into the engine oil before the typical owner sees serious symptoms or engine codes. (Also, to R&R the spark plugs, coils, PCV valve, and O2 sensors, the intake manifold must be removed, adding $hours$ to the simple maintenance effort). At times, I think BMW engineers are subbing out to help Ford with their engine designs. 🙄😫.
But anyhow, look for a 2016-2018 (at least, no older than 2015) if you're targeting a Wethead (i.e. the 2010-2013 models are also R1200RT's, but different engineering, no radiator, different issues), and I'd try to keep the mileage down to about 30K miles. You can spend a bit more money now, and ride more, or spend it later, and ride less while it's in the shop (or you're working on it in your garage). However, it's tough to get into these things for "free". Now, I might take a flyer on a 2015, with say, 60K miles, for something like $6K USD, but I wouldn't overspend on an older bike. A pretty bike can be very deceiving.
(Attached is a technical report on the rocker arm flaws ...)