Error Message: unexpected symbol in code

Hi, I am trying to put this into R, but it keeps telling me I have an "unexpected symbol". I even don't know what I have to do (I'am on the Beginner Level in R).

Anpassung <- rpart(dataset ~ Alter + Tarifgruppe + Fahrerkreis + Schadenfreiheitsklasse + Regionalklasse + Typklasse + jährliche Fahrleistung + Fahrzeugalter + Abstellort + Beitragszahlung, data = Training)

Thanks for your help!

This does not conform to R's naming requirements. (Space in a bare name). If it is your column name (because you can rename columns to to not have spaces), you need to surround it with backticks so R understands.

+ `jährliche Fahrleistung` +

Hey nirgrahamuk,

thanks for your message! It works, but i get a different error message like "invalid model formula in ExtractVars".
Here you can find my summary of the dataset/dataframe i'll use:

You seem to have confusion over whether your data is called dataset or Training. For the formula, the left side of the tilde should be the dependent variable

I understand my misconception. But now i don't have any idea how i can build a decision tree based on my data you can see in the summary....

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.