Step 1: The package "party" has the function ctree() which is used to create and analyze decison tree. > install.packages("party") Step 2: Load the party package. It will automatically load other# dependent packages Print some records from data set readingSkills > library("party") print(head (readingskills)) nativespeaker age shoesize yes $ 24.83189 32.29385 yes 6 25.95238 36.63105 score 11 30.42170 49.60593 no yes 7 28.66450 40.28456 yes 11 31.88207 55.46085 6 yes 10 30.07843 52.83124 Step 3: Call function ctree to build a decision tree. The first parameter is a formula, which defines a target variable and a list of independent variables. >iris ctree ctree(spectes sepal. Length sepal, width Petal. Length Peta 1.width, data-tris) print(iris ctree) Conditional inference tree with 4 terminal nodes. Response: species Inputs: Sepal.Length, Sepal.width, Petal. Length, Petal, width Number of observations: 150 1) Petal. Length 1.9; criterion 1, statistic 140.264 2) weights 50 1) Petal. Length > 1.9 3) Petal.width 1.7; criterion 1, statistic 07.894 4) Petal. Length 4.8: criterion 0.999, statistic 13.065 5) weights 46 4 6) ) weights ) Petal Length 4.8 3 ) Petal, width > 1.7 7) weights 46 > plot(iris ctree)