I use the randomForest package in R but I'm getting the following error:Error in eval(expr, envir, enclos) : object 'a' not foundThe line that causes the problem is the following:model = randomForest(class ~ a + b + c, data=train, ntree=100I looked up the error and apparently it has to do with the fact that train does not contain a, but I manually checked train and it does contain a.As a matter of fact, when I try to build a decision tree instead, it works just fine! (with the same formula and dataset)model = rpart(class ~ a + b + c, data=train, method=class)So I don't understand where this error is coming from. Any ideas?EDIT: There seems to be a problem with the fact that I use bigrams for my text. If I just use unigrams, it works fine. If I use this code for example:model = randomForest(class ~ `stack overflow`, data=train, ntree=100)It returns the error named above: object 'stack overflow' cannot be found.
Random Forest in R: Error in eval(expr, envir, enclos): object not found
r;random forest;decision trees
In general column names in R need to be formatted without spaces for R to recognize them properly. Importing files with spaces, R will drop in a period and remove the spaceThis limit is is true for variables as well, but it will not auto-format them for you. The most accepted methods for naming are:  stackOverflow camel case  stack_overflow with the underscore and a combination of lower and upper as you see fit  stack.overflow with period (which many dislike because it is often easy to not see the period)If you use these conventions you will avoid the name issue and be able to focus on the underlying models. A caveat, which may or may not matter to you. If you are going to pick a naming style and you work with other languages and pass data around, consider picking a style which works in both or all of them. It is easier for you to have one way, and it makes moving files easier if the names are compatible.