Successful quantitative analysis of electron di raction patterns from thin, polycrystalline samples requires careful attention todetail at each stage. First, one must record patterns from the unknown and standard under equivalent electron optical conditions (equivalent lens currents corrected for hysteresis.) Next, one must locate the center of each pattern and measure and correct for the elliptical distortion [1, 2, 3] and compute a radial average. The continuous scattering(background) must be subtracted. Peak positions from the standard are then used to determine the camera constant and calibrate the unknown pattern. The peaks in the unknown may then be compared to those expected from candidate structures. Until recently analysts in our laboratory have used a pair of programs with graphical user interfaces to locate the center and compute the elliptical distortion [2] and to correct the distortion, calibrate the pattern, and compare [3] to the ICDD di raction database. This analysis required a lot of "point-click-copy-paste" by the analyst and was di cult to automate. This report summarizes the development of a more e cient and reproducible work ow. Our tool chain permits more automated report generation as outlined by Vandewalle et al.[4].To obtain the required precision, the pattern from the standard is acquired after that of the unknown using the same lens currents, corrected for hysteresis by a normalization procedure in both the imaging and di raction mode of the microscope. The analyst uses a DigitalMicrograph plug-in, EDP, derived from VHou's plug-in [2] and extended to correct the distortion as outlined by Capitani et al. [1], perform the radial average, and output the pro le as a comma-delimited le. All the postprocessing uses the Open Source R language. The core functions (unit operations) to tune the background subtraction of the radially-averaged intensity, measure the camera constant from the standard, plot a calibrated background-subtracted pro le from an unknown pattern, and overlay lines from known phases were encapsulated in a custom R package, edp, which permits an analyst to tune and script an analysis of a new material with a minimum amount of coding. Background subtraction and peak location functions were used from the R package, Peaks [5]. This approach is consistent with the "do not repeat yourself" (DRY) coding practice to minimize inconsistencies. The edp package contains data and examples (unit tests) that are run each time the package is built and checked. The source code for both our DigitalMicrograph plug-in and the R package are maintained under version control using the distributed version control program, git. We intend to release both packages under the Gnu Public License. A typical work ow is to tune the background subtraction for a new unknown pattern, measure the camera constant for the standard, display the pattern and compare to candidate phases using a script using the Open Source RStudio integrated development environment. The Sweave package in R permits the analyst to em...