Pie chart pie slices not matching legend percentages

Thanks for providing code. Could you kindly take further steps to make it easier for other forum users to help you? Share some representative data that will enable your code to run and show the problematic behaviour.

How do I share data for a reprex?

You might use tools such as the library datapasta, or the base function dput() to share a portion of data in code form, i.e. that can be copied from forum and pasted to R session.

Reprex Guide

Advice.
If you have code that process a files is your issue about reading in files ?
If your issue does not relate to file reading , i.e . You have no problem loading your raw data, and if your problem is not about manipulating/processing it, but only a plotting aspect; then you should modify your example to exclude all file loading code and pre graphing manipulation and substitute that code with example data that you prepared following the attached guide.