inst/examples/linreg/report.R

# Prepare plots and tables for report

# Before: fit.csv (output)
# After:  fit.csv, fit.png (report)

library(TAF)

mkdir("report")

# Read output
coef <- read.taf("output/coef.csv")
fit <- read.taf("output/fit.csv")

# Plot
taf.png("fit")
plot(dist~speed, fit, xlab="Speed (mph)", ylab="Stopping distance (ft)")
lines(fit~speed, fit)
dev.off()

# Tables with rounded numbers
coef <- round(coef, 3)
fit <- round(fit, 3)
write.taf(coef, dir="report")
write.taf(fit, dir="report")

Try the TAF package in your browser

Any scripts or data that you put into this service are public.

TAF documentation built on Nov. 5, 2025, 7:21 p.m.