Trying to combine 2 data.frame on R with rbind and getting a error in match.names(clabs, names(xi)) : names do not match previous names -


trying combine 2 data.frame on r rbind line of code data.combined <- rbind(train, test.survived) getting error in match.names(clabs, names(xi)) : names not match previous names

the solution problem following codeline while adding survived variable

use this:

test.survived <- data.frame(survived = rep("none", nrow(test)), test[,]) 

instead of this:

test.survived <- data.frame(survived = rep("none", nrow(test)), test[,]) 

the difference capital "s" survived row data given in manner


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -