Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: dsc88dsc88For those interested, here is a more colourful example image:
node:Example_R_Chart_Image
bretype:r::R
editor:Label=Example R Chart Image
editor:sortkey=5346787d2ba16e34_9
input:5346787f7311612a/myInput=Static_Data_2.40fe6c55598828e5
output:5346790939853e75/ExampleImage=
prop:RScript=<<EOX
# Display the Student's t distributions with various degrees of freedom and compare to the normal distribution
x <- seq(-4, 4, length=1000)
hx <- dnorm(x)
outD <- data.frame(hx)
degf <- c(1, 3, 8, 30)
colors <- c("red", "blue", "darkgreen", "gold", "black")
labels <- c("df=1", "df=3", "df=8", "df=30", "normal")
outFr <- data.frame(degf)
createImage("ExampleImage")
plot(x, hx, type="l", lty=2, xlab="x value",
ylab="Density", main="Comparison of t Distributions")
for (i in 1:4){
lines(x, dt(x,degf[i]), lwd=2, col=colors[i])
}
legend("topright", inset=.05, title="Distributions",
labels, lwd=2, lty=c(1, 1, 1, 1, 2), col=colors)
EOX
editor:XY=390,340
end:Example_R_Chart_Image