## Not run:
# library(intubate)
# library(magrittr)
# library(tree)
#
# data(cpus, package="MASS")
#
# ## Original function to interface
# cpus.ltr <- tree(log10(perf) ~ syct+mmin+mmax+cach+chmin+chmax, cpus)
# cpus.ltr
# summary(cpus.ltr)
# plot(cpus.ltr)
# text(cpus.ltr)
#
# ## The interface reverses the order of data and formula
# cpus.ltr <- ntbt_tree(cpus, log10(perf) ~ syct+mmin+mmax+cach+chmin+chmax)
# cpus.ltr
# summary(cpus.ltr)
# plot(cpus.ltr); text(cpus.ltr)
#
# ## so it can be used easily in a pipeline.
# cpus %>%
# ntbt_tree(log10(perf) ~ syct + mmin + mmax + cach + chmin + chmax) %>%
# summary()
#
# cpus %>%
# ntbt_tree(log10(perf) ~ syct + mmin + mmax + cach + chmin + chmax) %T>%
# plot() %>%
# text()
#
# iris %>%
# ntbt_tree(Species ~.) %>%
# summary()
# ## End(Not run)
Run the code above in your browser using DataLab