Tag Archives: R

R Plotting a Function Curve

knowledge representation

> curve(x^3 - 5*x, from=-4, to=4)
> png(file="RcurveA.png")
> curve(x^3 - 5*x, from=-4, to=4)
> dev.off()
null device 
          1 
> png(file="RcurveB.png")
> curve(x^3 - 5*x, from=-4, to=0)
> dev.off()
null device 
          1 
> png(file="RcurveC.png")
> curve(x^3 - 5*x, from=10, to=50)
> dev.off()
null device 
          1 
> 

RcurveARcurveBRcurveC

R boxplot

knowledge representation

> boxplot
function (x, ...) 
UseMethod("boxplot")


> boxplot(1,2)
> boxplot(1,2)
> boxplot(1,2,3)
> threads <- factor(c(0,1,2,3,4,5,6,7,8,9))
> levels(threads)
 [1] "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"
> maximum <- c(10,11,12,13,14,15,16,17,18,19,20)
> boxplot(threads,maximum)
> minimum <- c(10,11,12,13,14,15,16,17,18,19,20)
> boxplot(threads,maximum,minimum)
> actual <- c(13,14,15,16,17)
> boxplot(threads,maximum,minimum,actual)
> png(file="Rboxplot.png")
> boxplot(threads,maximum,minimum,actual)
> dev.off()
null device 
          1 
> 

Rboxplot