In using the neuralnet package, the input data set to the neuralnet call cannot have string/character variables - for example column "username" with say 10-20 different values, depending on the data set. To convert that I would prefer to be able to enumerate that column - so say "John" becomes 1, "Mike" becomes 2, etc, then reverse it when done with the model run, in case that is needed. However calls that I found so far - like model.matrix() or class.ind() will generate multiple columns - so if I got 5 distinct user names in the user column, it will generate five columns with 1/0 in each; That variability in number of columns creates the problem with the downstream code - is there a function that would enumerate that string column and return the map - then perhaps reverse call to remap back when all done?
Without details of your app, any advice is going to involve a lot of guesswork. All I can suggest is that you clearly identify usernames in the model: maybe a prefix like "uname_" and search for that in downstream code.
As for why an integer encoding is filled with modelling traps:
If "John" is 1 and "Mike" is 2, then all sorts of things are mathematically true:
John < Mike
Mike = John + 1
Mike = John + John
Mike = John * 2
Usually, the real-world interpretation of those equations makes no sense with categorical variables like names.
Even cases where there's an obvious order, like multiple-choice survey questions such as "strongly disagree / disagree / agree / strongly agree", an encoding of 1,2,3,4 makes no mathematical sense: four "strongly disagrees" do not make a "strongly agree".
This is why your model matrix has one column per name, and uses binary values to indicate the presence of the name in that data row. The names aren't numbers that can be added up, and the model structure has to reflect this to be useful.
Hope that helps.
 Or possibly one less column than the number of names - depends on the model.