Display with commas is only possible in string format, as this is not part of default numeric markup.This would be impossible to use in R, because a vector like this c(100,230) could mean either the value 100230 or two separate values 100 and 230.
So formatting numbers by adding commas will always convert them to strings. Keep that as the last step before you generate the output.