Skip to content
Snippets Groups Projects
r_dataplot-checkpoint.r 394 B
Newer Older
Andrew Woodruff's avatar
Andrew Woodruff committed
args = commandArgs(trailingOnly=TRUE)

df = read.csv(args[1],header=TRUE, stringsAsFactors=FALSE)

head(df)
cat("...","\n")
tail(df)

cat("\n")
summary(df)

cat("\n","Saving the original figure...","\n")
png("r_orig.png")
plot(df$x, df$y)
dev.off()

relation <- lm(df$y~df$x)

relation

cat("Saving the linear modeling figure...","\n")
png("r_lm.png")
plot(df$x,df$y)
abline(relation)
dev.off()