Getting an error in function call r : Missing argument to function call

3173 views r

enter image description here

I am getting above mentioned error in R while creating trian data set.

Code: reg_train_df <-[,c("name", "price", "abtest", "vehicleType", "yearofRegistration", "gearbox", "powerPS", "model", "kilometer", "monthofRegistration", "fuelType", "brand", "notRepairedDamage", "postalCode", #"Log.price" )]) ```


Error in c("name", "price", "abtest", "vehicleType", "yearofRegistration", : argument 15 is empty

Show Traceback:

3. [.data.frame(train_df, , c("name", "price", "abtest", "vehicleType", "yearofRegistration", "gearbox", "powerPS", "model", "kilometer", "monthofRegistration", "fuelType", "brand", "notRepairedDamage", "postalCode", ))

2. train_df[, c("name", "price", "abtest", "vehicleType", "yearofRegistration", "gearbox", "powerPS", "model", "kilometer", "monthofRegistration", "fuelType", "brand", "notRepairedDamage", "postalCode", )]

1.[, c("name", "price", "abtest", "vehicleType", "yearofRegistration", "gearbox", "powerPS", "model", "kilometer", "monthofRegistration", "fuelType", "brand", "notRepairedDamage", "postalCode", )])

Please help to get rid of this error

answered question

1 Answer


It is because you forgot to remove the last comma.

For example this line

reg_train_df <-[,c("name", "price", "abtest", "vehicleType", "yearofRegistration", "gearbox", "powerPS", "model", "kilometer", "monthofRegistration", "fuelType", "brand", "notRepairedDamage", "postalCode", #"Log.price" )])

Should become:

   reg_train_df <-[,c("name", "price", "abtest", "vehicleType", "yearofRegistration", "gearbox", "powerPS", "model", "kilometer", "monthofRegistration", "fuelType", "brand", "notRepairedDamage", "postalCode" #"Log.price" 

posted this

Have an answer?


Please login first before posting an answer.