Hi @er48,
Welcome to the RStudio Community Forum.
You haven't provided us with any of your data to test, but it looks like you have processed 4 files and are then trying to add a column condition which has 10 values - hence the mismatch since all columns in a dataframe must be the same length. Try leaving out condition and check that the sampleTable dataframe looks as you expected (single column with correct number of rows?). This may then guide you how to adjust the condition vector to add as a column. Also, print the intermediate objects (file.list, counts.files, etc) to check their contents are as expected.
HTH