R : Copyright 2004, The R Foundation for Statistical Computing Version 2.0.1 (2004-11-15), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. Error in file.choose() : file choice cancelled > data(chem) Warning message: Data set 'chem' not found in: data(chem) > library(MASS) > data(chem) > chem [1] 2.90 3.10 3.40 3.40 3.70 3.70 2.80 2.50 2.40 2.40 2.70 2.20 [13] 5.28 3.37 3.03 3.03 28.95 3.77 3.40 2.20 3.50 3.60 3.70 3.70 > mean(chem) [1] 4.280417 > median(chem) [1] 3.385 > sqrt(var(chem)) [1] 5.297396 > mad(chem) [1] 0.526323 > ?mad > IQR(chem) [1] 0.925 > ?IQR > .925/1.349 [1] 0.6856931 > chem2 <- chem > chem2[17] <- 289.5 > median(chem2) [1] 3.385 > mean(chem2) [1] 15.13667 > sqrt(var(chem2)) [1] 58.44301 > mad(chem2) [1] 0.526323 > IQR(chem2) [1] 0.925 > huber(chem) $mu [1] 3.206724 $s [1] 0.526323 > hubers(chem) $mu [1] 3.205498 $s [1] 0.673652 > huber(chem2) $mu [1] 3.206724 $s [1] 0.526323 > hubers(chem2) $mu [1] 3.205498 $s [1] 0.673652 > ?fitdistr > fitdistr(chem,"t",list(m=mean(chem),s=sqrt(var(chem))) + ) Error in dt((x - m)/s, df, log = TRUE) : Argument "df" is missing, with no default > fitdistr(chem,"t",list(m=mean(chem),s=sqrt(var(chem))),df=5) m s 3.1855470 0.6423029 (0.1474964) (0.1279958) Warning messages: 1: NaNs produced in: log(x) 2: NaNs produced in: log(x) > fitdistr(chem,"t",list(m=mean(chem),s=sqrt(var(chem))),df=25) m s 3.3891189 2.2569286 (0.4743110) (0.6777613) > hist(chem) > ?hist > hist(chem,breaks=2:25) Error in hist.default(chem, breaks = 2:25) : some `x' not counted; maybe `breaks' do not span range of `x' > hist(chem,breaks=2:26) Error in hist.default(chem, breaks = 2:26) : some `x' not counted; maybe `breaks' do not span range of `x' > hist(chem,15) > hist(chem,breaks=c(1,2,3,4,5,10,15,20,25)) Error in hist.default(chem, breaks = c(1, 2, 3, 4, 5, 10, 15, 20, 25)) : some `x' not counted; maybe `breaks' do not span range of `x' > dotplot(chem) Error: couldn't find function "dotplot" > dot(chem) Error: couldn't find function "dot" > help.search(dot.plot) Error in help.search(dot.plot) : Object "dot.plot" not found > help.search("dot") > dotchart(chem) > hist(chem[-17]) > > ?dt > lines(chem[-17],dt((chem[-17]-3.39)/0.64),df=5) Error in dt((chem[-17] - 3.39)/0.64) : Argument "df" is missing, with no default > lines(chem[-17],dt((chem[-17]-3.39)/0.64,df=5)) > lines(chem[-17],dt((chem[-17]-3.39)/0.64,df=5)/0.64) > lines(sort(chem[-17]),dt(sort((chem[-17]-3.39)/0.64),df=5)/0.64) > lines(sort(chem[-17]),dt(sort((chem[-17]-3.39)/0.64),df=5)/0.64,col="red") > hist(chem[-17],freq=FALSE) > lines(sort(chem[-17]),dt(sort((chem[-17]-3.39)/0.64),df=5)/0.64,col="red") > quartz() > hist(chem,freq=FALSE) > lines(sort(chem),dt(sort((chem-3.39)/0.64),df=5)/0.64,col="red")