R is not going to be able to execute a .do file as that is Stata code. Are you looking for how to write something that you have in Stata but in R? If that's the case, share what you are trying to do in words as many of us don't know Stata. You could show the Stata code on the off-chance someone can help with a translation/conversion.