Small dataset results in regression tree with only 1 terminal node I don't understand why this decision tree has only one terminal node:
library(tree)

x1 = c(-10, -9, -11, -11, 0, 1, 0, 0)
x2 = c(-9, -11, -10, -11, 0, 0, 1, 0)
y = c(-50, -50.1, -50, -50, 8, 8, 7.9, 8)
df = data.frame(x1=x1, x2=x2, y=y)

t <- tree(y ~ ., df)
summary(t)


Your dataset is too small to split the nodes per the default control parameters of tree(). Admittedly, getting this out of ?tree requires digging additionally into ?tree.control. You can reduce the minimum number of data points per node and the minimum number per child node like this:
t <- tree(y ~ ., df,
    control=tree.control(nobs=nrow(df),mincut=4,minsize=8))

This gives you a tree with two terminal nodes.
