This answer is a summary from this webpage: http://rcompanion.org/handbook/H_02.html
There is a package called PropCIs that has two methods, the Clopper-Pearson Exact Method and the Blaker Exact Method. Here is an example of each:
The exactci function uses the Clopper–Pearson exact method.
7/21
[1] 0.3333333
library(PropCIs)
exactci(7, 21,
conf.level=0.95)
95 percent confidence interval:
0.1458769 0.5696755
The blakerci function uses the Blaker exact method.
7/21
[1] 0.3333333
library(PropCIs)
blakerci(7, 21,
conf.level=0.95)
95 percent confidence interval:
0.1523669 0.5510455