R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), 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. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("UsingR-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('UsingR') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "BushApproval" > > ### * BushApproval > > flush(stderr()); flush(stdout()) > > ### Name: BushApproval > ### Title: U.S. President George Bush approval ratings > ### Aliases: BushApproval > ### Keywords: datasets > > ### ** Examples > > data(BushApproval) > attach(BushApproval) > > ## Plot data with confidence intervals. Each poll gets different line type > ## no points at first > plot(strptime(date,"%m/%d/%y"),approval,type="n", + ylab = "Approval Rating",xlab="Date", + ylim=c(30,100) + ) > > ## plot line for CI. Margin or error about 3 > ## matlines has trouble with dates from strptime() > colors = rainbow(6) > > for(i in 1:nrow(BushApproval)) { + lines(rep(strptime(date[i],"%m/%d/%y"),2), + c(approval[i]-3,approval[i]+3), + lty=as.numeric(who[i]), + col=colors[as.numeric(who[i])] + ) + + } > > ## plot points > points(strptime(date,"%m/%d/%y"),approval,pch=as.numeric(who)) > > ## add legend > legend((2003-1970)*365*24*60*60,90,legend=as.character(levels(who)),lty=1:6,col=1:6) > detach(BushApproval) > > > > cleanEx(); ..nameEx <- "DOTplot" > > ### * DOTplot > > flush(stderr()); flush(stdout()) > > ### Name: DOTplot > ### Title: Make big DOT plot likestripchart > ### Aliases: DOTplot DOTplot.default DOTplot.formula DOTplt DOTplot.formula > ### Keywords: hplot > > ### ** Examples > > x = c(1,1,2,3,5,8) > DOTplot(x,main="Fibonacci",cex=2) > > > > cleanEx(); ..nameEx <- "MLBattend" > > ### * MLBattend > > flush(stderr()); flush(stdout()) > > ### Name: MLBattend > ### Title: Major league baseball attendance data > ### Aliases: MLBattend > ### Keywords: datasets > > ### ** Examples > > data(MLBattend) > boxplot(attendance ~ franchise, MLBattend) > with(MLBattend, cor(attendance,wins)) [1] 0.4584821 > > > > cleanEx(); ..nameEx <- "OBP" > > ### * OBP > > flush(stderr()); flush(stdout()) > > ### Name: OBP > ### Title: On base percentage for 2002 major league baseball season > ### Aliases: OBP > ### Keywords: datasets > > ### ** Examples > > data(OBP) > hist(OBP) > OBP[OBP>.5] # who is better than 50 bondsba01 0.5816993 > > > > cleanEx(); ..nameEx <- "QQplot" > > ### * QQplot > > flush(stderr()); flush(stdout()) > > ### Name: QQplot > ### Title: Creates a qqplot with shaded density estimate > ### Aliases: QQplot > ### Keywords: misc > > ### ** Examples > > > x = rnorm(100) > y = rt(100, df=3) > QQplot(x,y) > > > > > cleanEx(); ..nameEx <- "UsingR" > > ### * UsingR > > flush(stderr()); flush(stdout()) > > ### Name: UsingR > ### Title: Opens browser to UsingR webpages > ### Aliases: UsingR usingr > ### Keywords: misc > > ### ** Examples > > ## Not run: UsingR() # main webpage > ## Not run: UsingR("err") # errata > > > > cleanEx(); ..nameEx <- "age.universe" > > ### * age.universe > > flush(stderr()); flush(stdout()) > > ### Name: age.universe > ### Title: Best estimate of the age of the universe > ### Aliases: age.universe > ### Keywords: datasets > > ### ** Examples > > data(age.universe) > n = nrow(age.universe) > x = 1:15;names(x) = age.universe$year > plot(x,age.universe$upper,ylim=c(0,20)) > points(x,age.universe$lower) > with(age.universe,sapply(x,function(i) lines(c(i,i),c(lower[i],upper[i])))) $"1760" NULL $"1831" NULL $"1852" NULL $"1897" NULL $"1929" NULL $"1970" NULL $"1980" NULL $"1996" NULL $"1997" NULL $"1999" NULL $"1999" NULL $"2001" NULL $"2002" NULL $"2003" NULL $"2003" NULL > > > > cleanEx(); ..nameEx <- "alaska.pipeline" > > ### * alaska.pipeline > > flush(stderr()); flush(stdout()) > > ### Name: alaska.pipeline > ### Title: Comparison of in-field and laboratory measurement of defects > ### Aliases: alaska.pipeline > ### Keywords: datasets > > ### ** Examples > > data(alaska.pipeline) > res = lm(lab.defect ~ field.defect, alaska.pipeline) > plot(lab.defect ~ field.defect, alaska.pipeline) > abline(res) > plot(fitted(res),resid(res)) > > > > cleanEx(); ..nameEx <- "alltime.movies" > > ### * alltime.movies > > flush(stderr()); flush(stdout()) > > ### Name: alltime.movies > ### Title: Top movies of all time > ### Aliases: alltime.movies > ### Keywords: datasets > > ### ** Examples > > data(alltime.movies) > hist(alltime.movies$Gross) > > > > cleanEx(); ..nameEx <- "babies" > > ### * babies > > flush(stderr()); flush(stdout()) > > ### Name: babies > ### Title: Mothers and their babies data > ### Aliases: babies > ### Keywords: datasets > > ### ** Examples > > data(babies) > plot(wt ~ factor(smoke), data=babies) > plot(wt1 ~ dwt, data=babies, subset=wt1 < 800 & dwt < 800) > > > > cleanEx(); ..nameEx <- "babyboom" > > ### * babyboom > > flush(stderr()); flush(stdout()) > > ### Name: babyboom > ### Title: Babyboom: data for 44 babies born in one 24-hour period. > ### Aliases: babyboom > ### Keywords: datasets > > ### ** Examples > > data(babyboom) > hist(babyboom$wt) > hist(diff(babyboom$running.time)) > > > > cleanEx(); ..nameEx <- "batting" > > ### * batting > > flush(stderr()); flush(stdout()) > > ### Name: batting > ### Title: Batting statistics for 2002 baseball season > ### Aliases: batting > ### Keywords: datasets > > ### ** Examples > > data(batting) > attach(batting) > BA = H/AB # batting average > OBP = (H + BB + HBP) / (AB + BB + HBP + SF) # On base "percentage" > > > > cleanEx(); ..nameEx <- "baycheck" > > ### * baycheck > > flush(stderr()); flush(stdout()) > > ### Name: baycheck > ### Title: Population estimate of type of Bay Checkerspot butterfly > ### Aliases: baycheck > ### Keywords: datasets > > ### ** Examples > > data(baycheck) > plot(Nt ~ year,baycheck) > ## fit Ricker model N_{t+1} = N_t e^{-rt}W_t > n = length(baycheck$year) > yt = with(baycheck,log(Nt[-1]/Nt[-n])) > nt = with(baycheck,Nt[-n]) > lm(yt ~ nt,baycheck) Call: lm(formula = yt ~ nt, data = baycheck) Coefficients: (Intercept) nt 0.3458097 -0.0004088 > > > > cleanEx(); ..nameEx <- "best.times" > > ### * best.times > > flush(stderr()); flush(stdout()) > > ### Name: best.times > ### Title: Best track and field times by age and distance > ### Aliases: best.times > ### Keywords: datasets > > ### ** Examples > > data(best.times) > attach(best.times) > by.dist = split(best.times,as.factor(Dist)) > lm(scale(Time) ~ age, by.dist[['400']]) Call: lm(formula = scale(Time) ~ age, data = by.dist[["400"]]) Coefficients: (Intercept) age -3.01203 0.04819 > dists = names(by.dist) > lapply(dists, function(n) print(lm(scale(Time) ~ age, by.dist[[n]]))) Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -2.43879 0.03752 Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -3.05084 0.04694 Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -3.01203 0.04819 Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -2.82503 0.04346 Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -2.73766 0.04212 Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -3.09846 0.04958 Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -2.74438 0.04222 Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -3.04411 0.04871 Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -2.9123 0.0466 [[1]] Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -2.43879 0.03752 [[2]] Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -3.05084 0.04694 [[3]] Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -3.01203 0.04819 [[4]] Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -2.82503 0.04346 [[5]] Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -2.73766 0.04212 [[6]] Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -3.09846 0.04958 [[7]] Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -2.74438 0.04222 [[8]] Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -3.04411 0.04871 [[9]] Call: lm(formula = scale(Time) ~ age, data = by.dist[[n]]) Coefficients: (Intercept) age -2.9123 0.0466 > > > > cleanEx(); ..nameEx <- "breakdown" > > ### * breakdown > > flush(stderr()); flush(stdout()) > > ### Name: breakdown > ### Title: Time of insulating fluid to breakdown > ### Aliases: breakdown > ### Keywords: datasets > > ### ** Examples > > data(breakdown) > plot(log(time) ~ voltage, data = breakdown) > > > > cleanEx(); ..nameEx <- "bright.stars" > > ### * bright.stars > > flush(stderr()); flush(stdout()) > > ### Name: bright.stars > ### Title: List of bright stars with Hipparcos catalog number > ### Aliases: bright.stars > ### Keywords: datasets > > ### ** Examples > > data(bright.stars) > all.names = paste(bright.stars$name, sep="", collapse="") > x = unlist(strsplit(tolower(all.names), "")) > letter.dist = sapply(letters, function(i) sum(x == i)) > data(scrabble) # for frequency info > p = scrabble$frequency[1:26];p=p/sum(p) > chisq.test(letter.dist, p=p) # compare with English Chi-squared test for given probabilities data: letter.dist X-squared = 260.7295, df = 25, p-value < 2.2e-16 > > > > cleanEx(); ..nameEx <- "brightness" > > ### * brightness > > flush(stderr()); flush(stdout()) > > ### Name: brightness > ### Title: Brightness of 966 stars > ### Aliases: brightness > ### Keywords: datasets > > ### ** Examples > > data(brightness) > hist(brightness) > > > > cleanEx(); ..nameEx <- "bumpers" > > ### * bumpers > > flush(stderr()); flush(stdout()) > > ### Name: bumpers > ### Title: Bumper repair costs for various automobiles > ### Aliases: bumpers > ### Keywords: datasets > > ### ** Examples > > data(bumpers) > stem(bumpers) The decimal point is 3 digit(s) to the right of the | 0 | 68 1 | 333556 2 | 000123445 3 | 011233 > > > > cleanEx(); ..nameEx <- "bycatch" > > ### * bycatch > > flush(stderr()); flush(stdout()) > > ### Name: bycatch > ### Title: Number of Albatrosses accidentaly caught during a fishing haul > ### Aliases: bycatch > ### Keywords: datasets > > ### ** Examples > > data(bycatch) > hauls = with(bycatch,rep(no.albatross,no.hauls)) > > > > cleanEx(); ..nameEx <- "cabinet" > > ### * cabinet > > flush(stderr()); flush(stdout()) > > ### Name: cabinet > ### Title: Estimated tax savings for US President Bush's cabinet > ### Aliases: cabinet > ### Keywords: datasets > > ### ** Examples > > data(cabinet) > attach(cabinet) > median(est.dividend.cg) [1] 36002 > mean(est.dividend.cg) [1] 538818.2 > detach(cabinet) > > > > cleanEx(); ..nameEx <- "cancer" > > ### * cancer > > flush(stderr()); flush(stdout()) > > ### Name: cancer > ### Title: cancer survival times > ### Aliases: cancer > ### Keywords: datasets > > ### ** Examples > > data(cancer) > boxplot(cancer) > > > > cleanEx(); ..nameEx <- "carsafety" > > ### * carsafety > > flush(stderr()); flush(stdout()) > > ### Name: carsafety > ### Title: Fatality information in U.S. for several popular cars > ### Aliases: carsafety > ### Keywords: datasets > > ### ** Examples > > data(carsafety) > plot(Driver.deaths + Other.deaths ~ type, data = carsafety) > plot(Driver.deaths + Other.deaths ~ type, data = carsafety) > > > > cleanEx(); ..nameEx <- "central.park" > > ### * central.park > > flush(stderr()); flush(stdout()) > > ### Name: central.park > ### Title: Weather in Central Park NY in May 2003 > ### Aliases: central.park > ### Keywords: datasets > > ### ** Examples > > data(central.park) > attach(central.park) > barplot(rbind(MIN,MAX-MIN),ylim=c(0,80)) > > > > cleanEx(); ..nameEx <- "central.park.cloud" > > ### * central.park.cloud > > flush(stderr()); flush(stdout()) > > ### Name: central.park.cloud > ### Title: Type of day in Central Park, NY May 2003 > ### Aliases: central.park.cloud > ### Keywords: datasets > > ### ** Examples > > data(central.park.cloud) > table(central.park.cloud) central.park.cloud clear partly.cloudy cloudy 11 11 9 > > > > cleanEx(); ..nameEx <- "cfb" > > ### * cfb > > flush(stderr()); flush(stdout()) > > ### Name: cfb > ### Title: Bootstrap sample from the Survey of Consumer Finances > ### Aliases: cfb > ### Keywords: datasets > > ### ** Examples > > data(cfb) > attach(cfb) > mean(INCOME) [1] 63402.66 > > > > cleanEx(); ..nameEx <- "coins" > > ### * coins > > flush(stderr()); flush(stdout()) > > ### Name: coins > ### Title: The coins in my change bin > ### Aliases: coins > ### Keywords: datasets > > ### ** Examples > > data(coins) > years = cut(coins$year,seq(1920,2010,by=10),include.lowest=TRUE, + labels = paste(192:200,"*",sep="")) > table(years) years 192* 193* 194* 195* 196* 197* 198* 199* 200* 3 2 0 3 16 43 99 147 58 > > > > cleanEx(); ..nameEx <- "deflection" > > ### * deflection > > flush(stderr()); flush(stdout()) > > ### Name: deflection > ### Title: Deflection under load > ### Aliases: deflection > ### Keywords: datasets > > ### ** Examples > > data(deflection) > res = lm(Deflection ~ Load, data = deflection) > plot(Deflection ~ Load, data = deflection) > abline(res) # looks good? > plot(res) > > > > cleanEx(); ..nameEx <- "diamond" > > ### * diamond > > flush(stderr()); flush(stdout()) > > ### Name: diamond > ### Title: Price by size for diamond rings > ### Aliases: diamond > ### Keywords: datasets > > ### ** Examples > > data(diamond) > plot(price ~ carat, diamond, pch=5) > > > > cleanEx(); ..nameEx <- "dottodot" > > ### * dottodot > > flush(stderr()); flush(stdout()) > > ### Name: dottodot > ### Title: Dot-to-dot puzzle > ### Aliases: dottodot > ### Keywords: datasets > > ### ** Examples > > data(dottodot) > # make a blank graph > plot(y~x,data=dottodot,type="n",bty="n",xaxt="n",xlab="",yaxt="n",ylab="") > # add the points > points(y~x,data=dottodot) > # add the labels using pos argument > with(dottodot, text(x,y,labels=ind,pos=pos)) > # solve the puzzle > lines(y~x, data=dottodot) > > > > cleanEx(); ..nameEx <- "dvdsales" > > ### * dvdsales > > flush(stderr()); flush(stdout()) > > ### Name: dvdsales > ### Title: Monthly DVD player sales since introduction to May 2004 > ### Aliases: dvdsales > ### Keywords: datasets > > ### ** Examples > > data(dvdsales) > barplot(t(dvdsales[7:1,]),beside=TRUE) > > > > cleanEx(); ..nameEx <- "emissions" > > ### * emissions > > flush(stderr()); flush(stdout()) > > ### Name: emissions > ### Title: CO2 emissions data and gross domestic product for 26 countries > ### Aliases: emissions > ### Keywords: datasets > > ### ** Examples > > data(emissions) > plot(emissions) > > > > cleanEx(); ..nameEx <- "ewr" > > ### * ewr > > flush(stderr()); flush(stdout()) > > ### Name: ewr > ### Title: Taxi in and taxi out times at EWR (Newark) airport for 1999-2001 > ### Aliases: ewr > ### Keywords: datasets > > ### ** Examples > > data(ewr) > boxplot(ewr[3:10]) > > > > cleanEx(); ..nameEx <- "exec.pay" > > ### * exec.pay > > flush(stderr()); flush(stdout()) > > ### Name: exec.pay > ### Title: Direct compensation for 199 United States CEOs in the year 2000 > ### Aliases: exec.pay > ### Keywords: datasets > > ### ** Examples > > data(exec.pay) > hist(exec.pay) > > > > cleanEx(); ..nameEx <- "fat" > > ### * fat > > flush(stderr()); flush(stdout()) > > ### Name: fat > ### Title: Body measurements to predict percentage of body fat in males > ### Aliases: fat > ### Keywords: datasets > > ### ** Examples > > data(fat) > f = body.fat ~ age + weight + height + BMI + neck + chest + abdomen + + hip + thigh + knee + ankle + bicep + forearm + wrist > res = lm(f, data=fat) > summary(res) Call: lm(formula = f, data = fat) Residuals: Min 1Q Median 3Q Max -10.2573 -2.5919 -0.1031 2.9040 9.2754 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.519e+01 1.611e+01 -0.943 0.3467 age 5.688e-02 3.003e-02 1.894 0.0594 . weight -8.130e-02 4.989e-02 -1.630 0.1045 height -5.307e-02 1.034e-01 -0.513 0.6084 BMI 6.101e-02 2.780e-01 0.219 0.8265 neck -4.450e-01 2.184e-01 -2.037 0.0427 * chest -3.087e-02 9.779e-02 -0.316 0.7526 abdomen 8.790e-01 8.545e-02 10.286 <2e-16 *** hip -2.031e-01 1.371e-01 -1.481 0.1398 thigh 2.274e-01 1.356e-01 1.677 0.0948 . knee -9.927e-04 2.298e-01 -0.004 0.9966 ankle 1.572e-01 2.076e-01 0.757 0.4496 bicep 1.485e-01 1.600e-01 0.928 0.3543 forearm 4.297e-01 1.849e-01 2.324 0.0210 * wrist -1.479e+00 4.967e-01 -2.978 0.0032 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.996 on 237 degrees of freedom Multiple R-Squared: 0.749, Adjusted R-squared: 0.7342 F-statistic: 50.52 on 14 and 237 DF, p-value: < 2.2e-16 > > > > cleanEx(); ..nameEx <- "father.son" > > ### * father.son > > flush(stderr()); flush(stdout()) > > ### Name: father.son > ### Title: Pearson's data set on heights of fathers and their sons > ### Aliases: father.son > ### Keywords: datasets > > ### ** Examples > > data(father.son) > ## like cover of Freedman, Pisani, and Purves > plot(sheight ~ fheight, data=father.son,bty="l",pch=20) > abline(a=0,b=1,lty=2,lwd=2) > abline(lm(sheight ~ fheight, data=father.son),lty=1,lwd=2) > > > > cleanEx(); ..nameEx <- "female.inc" > > ### * female.inc > > flush(stderr()); flush(stdout()) > > ### Name: female.inc > ### Title: Income distribution for females in 2001 > ### Aliases: female.inc > ### Keywords: datasets > > ### ** Examples > > data(female.inc) > boxplot(income ~ race, female.inc) > boxplot(log(income,10) ~ race, female.inc) > sapply(with(female.inc,split(income,race)),median) black hispanic white 13619 6214 13619 > > > > cleanEx(); ..nameEx <- "firstchi" > > ### * firstchi > > flush(stderr()); flush(stdout()) > > ### Name: firstchi > ### Title: Age of mother at birth of first child > ### Aliases: firstchi > ### Keywords: datasets > > ### ** Examples > > data(firstchi) > hist(firstchi) > > > > cleanEx(); ..nameEx <- "five.yr.temperature" > > ### * five.yr.temperature > > flush(stderr()); flush(stdout()) > > ### Name: five.yr.temperature > ### Title: Five years of weather in New York City > ### Aliases: five.yr.temperature > ### Keywords: datasets > > ### ** Examples > > data(five.yr.temperature) > attach(five.yr.temperature) > scatter.smooth(temps ~ days,col=gray(.75)) > lines(smooth.spline(temps ~ days), lty=2) > lines(supsmu(days, temps), lty=3) > > > > cleanEx(); ..nameEx <- "florida" > > ### * florida > > flush(stderr()); flush(stdout()) > > ### Name: florida > ### Title: County-by-county results of year 2000 US presidential election > ### in Florida > ### Aliases: florida > ### Keywords: datasets > > ### ** Examples > > data(florida) > attach(florida) > result.lm <- lm(BUCHANAN ~ BUSH) > plot(BUSH,BUCHANAN) > abline(result.lm) ## can you find Palm Beach and Miami Dade counties? > > > > cleanEx(); ..nameEx <- "galileo" > > ### * galileo > > flush(stderr()); flush(stdout()) > > ### Name: galileo > ### Title: Galileo data on falling bodies > ### Aliases: galileo > ### Keywords: datasets > > ### ** Examples > > data(galileo) > polynomial = function(x,coefs) { + sum = 0 + for(i in 0:(length(coefs)-1)) { + sum = sum + coefs[i+1]*x^i + } + sum + } > res.lm = lm(h.d ~ init.h, data = galileo) > res.lm2 = update(res.lm, . ~ . + I(init.h^2), data=galileo) > res.lm3 = update(res.lm2, . ~ . + I(init.h^3), data=galileo) > plot(h.d ~ init.h, data = galileo) > curve(polynomial(x,coef(res.lm)),add=TRUE) > curve(polynomial(x,coef(res.lm2)),add=TRUE) > curve(polynomial(x,coef(res.lm3)),add=TRUE) > > > > > cleanEx(); ..nameEx <- "galton" > > ### * galton > > flush(stderr()); flush(stdout()) > > ### Name: galton > ### Title: Galton's height data for parents and children > ### Aliases: galton > ### Keywords: datasets > > ### ** Examples > > data(galton) > plot(galton) > ## or with some jitter. > plot(jitter(child,5) ~ jitter(parent,5),galton) > ## sunflowerplot shows flowers for multiple plots (Thanks MM) > sunflowerplot(galton) > > > > cleanEx(); ..nameEx <- "getAnswer" > > ### * getAnswer > > flush(stderr()); flush(stdout()) > > ### Name: getAnswer > ### Title: Display answers to selected problems > ### Aliases: getAnswer > ### Keywords: utilities > > ### ** Examples > > getAnswer() getAnswer() needs to be called with a chapter and problem number. The available answers are: [1] "1.5" "1.6" "1.7" "1.9" "1.10" "1.16" "1.17" "1.19" "1.24" [10] "1.27" "2.5" "2.9" "2.12" "2.13" "2.14" "2.17" "2.19" "2.20" [19] "2.22" "2.34" "2.35" "2.39" "2.45" "3.2" "3.3" "3.4" "3.7" [28] "3.9" "3.1" "3.12" "3.14" "3.17" "3.21" "3.24" "3.25" "3.28" [37] "3.30" "3.32" "3.33" "4.1" "4.2" "4.3" "4.5" "4.6" "4.10" [46] "4.12" "4.15" "4.16" "4.17" "4.22" "4.25" "4.27" "5.3" "5.9" [55] "5.10" "5.12" "5.16" "5.19" "5.21" "5.27" "5.28" "5.30" "6.2" [64] "6.3" "6.4" "6.5" "6.7" "6.10" "7.5" "7.8" "7.11" "7.13" [73] "7.15" "7.17" "7.18" "7.22" "7.24" "7.27" "7.29" "7.31" "7.32" [82] "8.1" "8.2" "8.5" "8.6" "8.9" "8.12" "8.16" "8.17" "8.18" [91] "8.21" "8.27" "8.28" "8.35" "9.3" "9.7" "9.11" "9.13" "9.17" [100] "9.19" "9.20" "10.1" "10.6" "10.9" "10.11" "10.13" "10.16" "10.20" [109] "10.21" "10.25" "10.27" "10.29" "11.1" "11.3" "11.6" "11.10" "11.12" [118] "11.14" "11.16" "11.18" "11.19" "11.22" "11.25" "11.26" "11.28" "12.1" [127] "12.8" "12.9" "12.10" > > > > cleanEx(); ..nameEx <- "grades" > > ### * grades > > flush(stderr()); flush(stdout()) > > ### Name: grades > ### Title: Current and previous grades > ### Aliases: grades > ### Keywords: datasets > > ### ** Examples > > data(grades) > table(grades) grade prev A A- B+ B B- C+ C D F A 15 3 1 4 0 0 3 2 0 A- 3 1 1 0 0 0 0 0 0 B+ 0 2 2 1 2 0 0 1 1 B 0 1 1 4 3 1 3 0 2 B- 0 1 0 2 0 0 1 0 0 C+ 1 1 0 0 0 0 1 0 0 C 1 0 0 1 1 3 5 9 7 D 0 0 0 1 0 0 4 3 1 F 1 0 0 1 1 1 3 4 11 > > > > cleanEx(); ..nameEx <- "grip" > > ### * grip > > flush(stderr()); flush(stdout()) > > ### Name: grip > ### Title: Effects of cross-country ski-pole grip > ### Aliases: grip > ### Keywords: datasets > > ### ** Examples > > data(grip) > ftable(xtabs(UBP ~ person + replicate + grip.type,grip)) grip.type classic integrated modern person replicate 1 1 168.2084 166.7134 160.0739 2 161.4141 173.0319 161.2383 3 163.2345 173.2537 166.7635 2 1 155.9429 165.4825 161.8334 2 168.5388 166.0498 162.7900 3 166.3163 170.5794 157.5793 3 1 162.6191 174.8182 165.2248 2 157.8030 166.8222 162.7804 3 171.6529 165.2776 159.7632 4 1 165.1400 174.8661 160.3049 2 164.9525 173.0058 168.5381 3 158.2008 165.1532 164.4688 > > > > cleanEx(); ..nameEx <- "hall.fame" > > ### * hall.fame > > flush(stderr()); flush(stdout()) > > ### Name: hall.fame > ### Title: Data frame containing baseball statistics including Hall of Fame > ### membership > ### Aliases: hall.fame > ### Keywords: datasets > > ### ** Examples > > data(hall.fame) > hist(hall.fame$OBP) > with(hall.fame,last[Hall.Fame.Membership != "not a member"]) [1] "AARON" "ANSON" "APARICIO" "APPLING" "ASHBURN" [6] "AVERILL" "BAKER" "BANCROFT" "BANKS" "BECKLEY" [11] "BENCH" "BERRA" "BOTTOMLEY" "BOUDREAU" "BRESNAHAN" [16] "BROCK" "BROUTHERS" "BURKETT" "CAMPANELLA" "CAREW" [21] "CAREY" "CEPEDA" "CHANCE" "CLARKE" "CLEMENTE" [26] "COBB" "COCHRANE" "COLLINS" "COLLINS" "COMBS" [31] "CONNOR" "CRAWFORD" "CRONIN" "CUYLER" "DAVIS" [36] "DELAHANTY" "DICKEY" "DiMAGGIO" "DOBY" "DOERR" [41] "DUFFY" "EVERS" "EWING" "FERRELL" "FLICK" [46] "FOX" "FOXX" "FRISCH" "GEHRIG" "GEHRINGER" [51] "GOSLIN" "GREENBERG" "HAFEY" "HAMILTON" "HARTNETT" [56] "HEILMANN" "HERMAN" "HOOPER" "HORNSBY" "JACKSON" [61] "JACKSON" "JENNINGS" "KALINE" "KEELER" "KELL" [66] "KELLEY" "KELLY" "KELLY" "KILLEBREW" "KINER" [71] "KLEIN" "LAJOIE" "LAZZERI" "LINDSTROM" "LOMBARDI" [76] "MANTLE" "MANUSH" "MARANVILLE" "MATHEWS" "MAYS" [81] "McCARTHY" "McCOVEY" "McPHEE" "MEDWICK" "MIZE" [86] "MORGAN" "MUSIAL" "O'ROURKE" "OTT" "PEREZ" [91] "REESE" "RICE" "RIZZUTO" "ROBINSON" "ROBINSON" [96] "ROBINSON" "ROUSH" "RUTH" "SCHALK" "SCHMIDT" [101] "SCHOENDIENST" "SEWELL" "SIMMONS" "SISLER" "SLAUGHTER" [106] "SNIDER" "SPEAKER" "STARGELL" "TERRY" "THOMPSON" [111] "TINKER" "TRAYNOR" "VAUGHAN" "WAGNER" "WALLACE" [116] "WANER" "WANER" "WARD" "WHEAT" "WILLIAMS" [121] "WILLIAMS" "WILSON" "YASTRZEMSKI" "YOUNGS" > > > > cleanEx(); ..nameEx <- "healthy" > > ### * healthy > > flush(stderr()); flush(stdout()) > > ### Name: healthy > ### Title: Healthy or not? > ### Aliases: healthy > ### Keywords: datasets > > ### ** Examples > > data(healthy) > library(MASS) > stepAIC(glm(healthy ~ p + g, healthy, family=binomial)) Start: AIC= 28.97 healthy ~ p + g Df Deviance AIC - g 1 24.840 28.840 22.971 28.971 - p 1 28.945 32.945 Step: AIC= 28.84 healthy ~ p Df Deviance AIC 24.840 28.840 - p 1 30.885 32.885 Call: glm(formula = healthy ~ p, family = binomial, data = healthy) Coefficients: (Intercept) p -6.845 1.827 Degrees of Freedom: 31 Total (i.e. Null); 30 Residual Null Deviance: 30.88 Residual Deviance: 24.84 AIC: 28.84 > > > > cleanEx(); ..nameEx <- "homedata" > > ### * homedata > > flush(stderr()); flush(stdout()) > > ### Name: homedata > ### Title: Property assessments for Maplewood NJ > ### Aliases: homedata > ### Keywords: datasets > > ### ** Examples > > data(homedata) > plot(homedata) > abline(lm(y2000 ~ y1970, data=homedata)) > > > > cleanEx(); ..nameEx <- "kid.weights" > > ### * kid.weights > > flush(stderr()); flush(stdout()) > > ### Name: kid.weights > ### Title: Weight and height measurement for a sample of U.S. children > ### Aliases: kid.weights > ### Keywords: datasets > > ### ** Examples > > data(kid.weights) > attach(kid.weights) > plot(weight,height,pch=as.character(gender)) > ## find the BMI -- body mass index > m.ht = height*2.54/100 # 2.54 cm per inch > m.wt = weight / 2.2046 # 2.2046 lbs. per kg > bmi = m.wt/m.ht^2 > hist(bmi) > > > > cleanEx(); ..nameEx <- "last.tie" > > ### * last.tie > > flush(stderr()); flush(stdout()) > > ### Name: last.tie > ### Title: Last tie in 100 coin tosses > ### Aliases: last.tie > ### Keywords: datasets > > ### ** Examples > > data(last.tie) > hist(last.tie) > > > > cleanEx(); ..nameEx <- "lawsuits" > > ### * lawsuits > > flush(stderr()); flush(stdout()) > > ### Name: lawsuits > ### Title: Law suit settlements > ### Aliases: lawsuits > ### Keywords: datasets > > ### ** Examples > > data(lawsuits) > mean(lawsuits) [1] 34435.12 > median(lawsuits) [1] 6038.5 > > > > cleanEx(); ..nameEx <- "mandms" > > ### * mandms > > flush(stderr()); flush(stdout()) > > ### Name: mandms > ### Title: Proportions of colors in various M and M's varieties > ### Aliases: mandms > ### Keywords: datasets > > ### ** Examples > > data(mandms) > bagfull = c(15,34,7,19,29,24) > names(bagfull) = c("blue","brown","green","orange","red","yellow") > prop = function(x) x/sum(x) > chisq.test(bagfull,p = prop(mandms["milk chocolate",])) Chi-squared test for given probabilities data: bagfull X-squared = 7.0651, df = 5, p-value = 0.2158 > chisq.test(bagfull,p = prop(mandms["Peanut",])) Chi-squared test for given probabilities data: bagfull X-squared = 13.3281, df = 5, p-value = 0.02049 > > > > cleanEx(); ..nameEx <- "math" > > ### * math > > flush(stderr()); flush(stdout()) > > ### Name: math > ### Title: Standardized math scores > ### Aliases: math > ### Keywords: datasets > > ### ** Examples > > data(math) > hist(math) > > > > cleanEx(); ..nameEx <- "maydow" > > ### * maydow > > flush(stderr()); flush(stdout()) > > ### Name: maydow > ### Title: Dow Jones industrial average and May maximum temperature > ### Aliases: maydow > ### Keywords: datasets > > ### ** Examples > > data(maydow) > attach(maydow) > plot(max.temp,DJA) > plot(max.temp[-1],diff(DJA)) > > > > cleanEx(); ..nameEx <- "midsize" > > ### * midsize > > flush(stderr()); flush(stdout()) > > ### Name: midsize > ### Title: Price of new and used of three mid-sized cars > ### Aliases: midsize > ### Keywords: datasets > > ### ** Examples > > data(midsize) > plot(Accord ~ I(2004-Year), data = midsize) > > > > cleanEx(); ..nameEx <- "mw.ages" > > ### * mw.ages > > flush(stderr()); flush(stdout()) > > ### Name: mw.ages > ### Title: Age distribution in year 2000 in Maplewood New Jersey > ### Aliases: mw.ages > ### Keywords: datasets > > ### ** Examples > > data(mw.ages) > barplot(mw.ages$Male + mw.ages$Female) > > > > cleanEx(); ..nameEx <- "nba.draft" > > ### * nba.draft > > flush(stderr()); flush(stdout()) > > ### Name: nba.draft > ### Title: NBA draft lottery odds for 2002 > ### Aliases: nba.draft > ### Keywords: datasets > > ### ** Examples > > data(nba.draft) > top.pick = sample(row.names(nba.draft),1,prob = nba.draft$Balls) > > > > cleanEx(); ..nameEx <- "normtemp" > > ### * normtemp > > flush(stderr()); flush(stdout()) > > ### Name: normtemp > ### Title: Body temperature and heart rate of 130 health individuals > ### Aliases: normtemp > ### Keywords: datasets > > ### ** Examples > > data(normtemp) > hist(normtemp$temperature) > t.test(normtemp$temperature,mu=98.2) One Sample t-test data: normtemp$temperature t = 0.7656, df = 129, p-value = 0.4453 alternative hypothesis: true mean is not equal to 98.2 95 percent confidence interval: 98.12200 98.37646 sample estimates: mean of x 98.24923 > summary(lm(temperature ~ factor(gender), normtemp)) Call: lm(formula = temperature ~ factor(gender), data = normtemp) Residuals: Min 1Q Median 3Q Max -1.993846 -0.471538 0.006154 0.406154 2.406154 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 98.10462 0.08949 1096.298 <2e-16 *** factor(gender)2 0.28923 0.12655 2.285 0.0239 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.7215 on 128 degrees of freedom Multiple R-Squared: 0.03921, Adjusted R-squared: 0.0317 F-statistic: 5.223 on 1 and 128 DF, p-value: 0.02393 > > > > cleanEx(); ..nameEx <- "npdb" > > ### * npdb > > flush(stderr()); flush(stdout()) > > ### Name: npdb > ### Title: National Practioner Data Bank > ### Aliases: npdb > ### Keywords: datasets > > ### ** Examples > > data(npdb) > table(table(npdb$ID)) # big offenders 1 2 3 4 5 6 8 11 15 22 73 6105 235 12 4 7 1 1 1 1 1 1 > hist(log(npdb$amount)) # log normal? > > > > cleanEx(); ..nameEx <- "nym.2002" > > ### * nym.2002 > > flush(stderr()); flush(stdout()) > > ### Name: nym.2002 > ### Title: Random sample of 2002 New York City Marathon finishers > ### Aliases: nym.2002 > ### Keywords: datasets > > ### ** Examples > > data(nym.2002) > with(nym.2002, cor(time,age)) [1] 0.1898672 > > > > cleanEx(); ..nameEx <- "oral.lesion" > > ### * oral.lesion > > flush(stderr()); flush(stdout()) > > ### Name: oral.lesion > ### Title: Oral lesion location by town > ### Aliases: oral.lesion > ### Keywords: datasets > > ### ** Examples > > data(oral.lesion) > chisq.test(oral.lesion)$p.value Warning in chisq.test(oral.lesion) : Chi-squared approximation may be incorrect [1] 0.1400186 > chisq.test(oral.lesion,simulate.p.value=TRUE)$p.value ## exact is.0269 [1] 0.02898551 > > > > cleanEx(); ..nameEx <- "pi2000" > > ### * pi2000 > > flush(stderr()); flush(stdout()) > > ### Name: pi2000 > ### Title: first 2000 digits of pi > ### Aliases: pi2000 > ### Keywords: datasets > > ### ** Examples > > data(pi2000) > chisq.test(table(pi2000)) Chi-squared test for given probabilities data: table(pi2000) X-squared = 4.42, df = 9, p-value = 0.8817 > > > > cleanEx(); ..nameEx <- "primes" > > ### * primes > > flush(stderr()); flush(stdout()) > > ### Name: primes > ### Title: Primes numbers less than 2003 > ### Aliases: primes > ### Keywords: datasets > > ### ** Examples > > data(primes) > diff(primes) [1] 1 2 2 4 2 4 2 4 6 2 6 4 2 4 6 6 2 6 4 2 6 4 6 8 4 [26] 2 4 2 4 14 4 6 2 10 2 6 6 4 6 6 2 10 2 4 2 12 12 4 2 4 [51] 6 2 10 6 6 6 2 6 4 2 10 14 4 2 4 14 6 10 2 4 6 8 6 6 4 [76] 6 8 4 8 10 2 10 2 6 4 6 8 4 2 4 12 8 4 8 4 6 12 2 18 6 [101] 10 6 6 2 6 10 6 6 2 6 6 4 2 12 10 2 4 6 6 2 12 4 6 8 10 [126] 8 10 8 6 6 4 8 6 4 8 4 14 10 12 2 10 2 4 2 10 14 4 2 4 14 [151] 4 2 4 20 4 8 10 8 4 6 6 14 4 6 6 8 6 12 4 6 2 10 2 6 10 [176] 2 10 2 6 18 4 2 4 6 6 8 6 6 22 2 10 8 10 6 6 8 12 4 6 6 [201] 2 6 12 10 18 2 4 6 2 6 4 2 4 12 2 6 34 6 6 8 18 10 14 4 2 [226] 4 6 8 4 2 6 12 10 2 4 2 4 6 12 12 8 12 6 4 6 8 4 8 4 14 [251] 4 6 2 4 6 2 6 10 20 6 4 2 24 4 2 10 12 2 10 8 6 6 6 18 6 [276] 4 2 12 10 12 8 16 14 6 4 2 4 2 10 12 6 6 18 2 16 2 22 6 8 6 [301] 4 2 4 > > > > cleanEx(); ..nameEx <- "reaction.time" > > ### * reaction.time > > flush(stderr()); flush(stdout()) > > ### Name: reaction.time > ### Title: Reaction time with cell phone usage > ### Aliases: reaction.time > ### Keywords: datasets > > ### ** Examples > > data(reaction.time) > boxplot(time ~ control, data = reaction.time) > > > > cleanEx(); ..nameEx <- "reddrum" > > ### * reddrum > > flush(stderr()); flush(stdout()) > > ### Name: reddrum > ### Title: Growth of red drum > ### Aliases: reddrum > ### Keywords: datasets > > ### ** Examples > > data(reddrum) > plot(length ~ age, reddrum) > > > > cleanEx(); ..nameEx <- "salmon.rate" > > ### * salmon.rate > > flush(stderr()); flush(stdout()) > > ### Name: salmon.rate > ### Title: Simulated Data on Rate of Recruitment for Salmon > ### Aliases: salmon.rate > ### Keywords: datasets > > ### ** Examples > > data(salmon.rate) > hist(log(salmon.rate)) > > > > cleanEx(); ..nameEx <- "samhda" > > ### * samhda > > flush(stderr()); flush(stdout()) > > ### Name: samhda > ### Title: Substance Abuse and Mental Health Data for teens > ### Aliases: samhda > ### Keywords: datasets > > ### ** Examples > > data(samhda) > attach(samhda) > table(amt.smoke) amt.smoke 1 2 3 4 5 6 7 98 99 32 7 13 10 14 43 105 358 18 > > > > cleanEx(); ..nameEx <- "scatter.with.hist" > > ### * scatter.with.hist > > flush(stderr()); flush(stdout()) > > ### Name: scatter.with.hist > ### Title: Scatterplot with histograms > ### Aliases: scatter.with.hist > ### Keywords: hplot multivariate > > ### ** Examples > > data(emissions) > attach(emissions) > scatter.with.hist(perCapita,CO2) > > > > cleanEx(); ..nameEx <- "scrabble" > > ### * scrabble > > flush(stderr()); flush(stdout()) > > ### Name: scrabble > ### Title: Distribution of Scrabble pieces > ### Aliases: scrabble > ### Keywords: datasets > > ### ** Examples > > data(scrabble) > ## perform chi-squared analysis on long string. Is it in English? > quote = " R is a language and environment for statistical computing \ + and graphics. It is a GNU project which is similar to the S language \ + and environment which was developed at Bell Laboratories (formerly \ + AT&T, now Lucent Technologies) by John Chambers and colleagues. R \ + can be considered as a different implementation of S. There are \ + some important differences, but much code written for S runs \ + unaltered under R." > quote.lc = tolower(quote) > quote = unlist(strsplit(quote.lc,"")) > ltr.dist = sapply(c(letters," "),function(x) sum(quote == x)) > chisq.test(ltr.dist,,scrabble$freq) Chi-squared test for given probabilities data: ltr.dist X-squared = 520.3043, df = 26, p-value < 2.2e-16 > > > > > cleanEx(); ..nameEx <- "sim" > > ### * sim > > flush(stderr()); flush(stdout()) > > ### Name: sim > ### Title: Function to simulate sampling distributions > ### Aliases: sim > ### Keywords: univar > > ### ** Examples > > > qqnorm(sim(n=10,family="exp")) > qqnorm(sim(n=10,family="t",df=3)) > qqnorm(sim(n=10,family="t",statistic="median",df=3)) > > > > > cleanEx(); ..nameEx <- "squareplot" > > ### * squareplot > > flush(stderr()); flush(stdout()) > > ### Name: squareplot > ### Title: Create a squareplot alternative to a segmented barplot > ### Aliases: squareplot > ### Keywords: hplot univar > > ### ** Examples > > ## A Roger Clemens Cy Young year > squareplot(c(21,7,6),col=c("blue","green","white")) > > > > cleanEx(); ..nameEx <- "stud.recs" > > ### * stud.recs > > flush(stderr()); flush(stdout()) > > ### Name: stud.recs > ### Title: Student records > ### Aliases: stud.recs > ### Keywords: datasets > > ### ** Examples > > data(stud.recs) > hist(stud.recs$sat.v) > with(stud.recs,cor(sat.v,sat.m)) [1] 0.4373411 > > > > cleanEx(); ..nameEx <- "student.expenses" > > ### * student.expenses > > flush(stderr()); flush(stdout()) > > ### Name: student.expenses > ### Title: Some simulated data on student expenses > ### Aliases: student.expenses > ### Keywords: datasets > > ### ** Examples > > data(student.expenses) > attach(student.expenses) > table(dial.up,cable.modem) cable.modem dial.up N Y N 5 2 Y 3 0 > > > > cleanEx(); ..nameEx <- "superbarplot" > > ### * superbarplot > > flush(stderr()); flush(stdout()) > > ### Name: superbarplot > ### Title: super segmented barplot > ### Aliases: superbarplot > ### Keywords: hplot multivariate > > ### ** Examples > > record.high=c(95,95,93,96,98,96,97,96,95,97) > record.low= c(49,47,48,51,49,48,52,51,49,52) > normal.high=c(78,78,78,79,79,79,79,80,80,80) > normal.low= c(62,62,62,63,63,63,64,64,64,64) > actual.high=c(80,78,80,68,83,83,73,75,77,81) > actual.low =c(62,65,66,58,69,63,59,58,59,60) > x=rbind(record.low,record.high,normal.low,normal.high,actual.low,actual.high) > the.names=c("S","M","T","W","T","F","S")[c(3:7,1:5)] > superbarplot(x,names=the.names) > > > > > cleanEx(); ..nameEx <- "tastesgreat" > > ### * tastesgreat > > flush(stderr()); flush(stdout()) > > ### Name: tastesgreat > ### Title: Does new goo taste great? > ### Aliases: tastesgreat > ### Keywords: datasets > > ### ** Examples > > data(tastesgreat) > summary(glm(enjoyed ~ gender + age, data=tastesgreat, family=binomial)) Call: glm(formula = enjoyed ~ gender + age, family = binomial, data = tastesgreat) Deviance Residuals: Min 1Q Median 3Q Max -1.84192 -0.88512 -0.06624 0.74655 2.55961 Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -8.18443 3.09644 -2.643 0.00821 ** genderMale 2.42241 0.95590 2.534 0.01127 * age 0.16491 0.06519 2.530 0.01142 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 55.452 on 39 degrees of freedom Residual deviance: 38.981 on 37 degrees of freedom AIC: 44.981 Number of Fisher Scoring iterations: 5 > > > > cleanEx(); ..nameEx <- "too.young" > > ### * too.young > > flush(stderr()); flush(stdout()) > > ### Name: too.young > ### Title: What age is too young for a male to data a female? > ### Aliases: too.young > ### Keywords: datasets > > ### ** Examples > > data(too.young) > lm(Female ~ Male, data=too.young) Call: lm(formula = Female ~ Male, data = too.young) Coefficients: (Intercept) Male 5.4720 0.5754 > > > > cleanEx(); ..nameEx <- "twins" > > ### * twins > > flush(stderr()); flush(stdout()) > > ### Name: twins > ### Title: Burt's IQ data for twins > ### Aliases: twins > ### Keywords: datasets > > ### ** Examples > > data(twins) > plot(Foster ~ Biological, twins) > > > > cleanEx(); ..nameEx <- "u2" > > ### * u2 > > flush(stderr()); flush(stdout()) > > ### Name: u2 > ### Title: Song and lengths for U2 albums > ### Aliases: u2 > ### Keywords: datasets > > ### ** Examples > > data(u2) > sapply(u2,mean) # average track length Achtung Baby Boy October 277.2500 230.2727 224.4545 Pop Rattle & Hum The Joshua Tree 300.4167 255.2353 273.7273 The Unforgettable Fire Under A Blood Red Sky War 256.0000 254.0000 228.9000 Zooropa 300.9000 > max(sapply(u2,max)) # longest track length [1] 416 > sort(unlist(u2)) # lengths in sorted order Rattle & Hum. (Freedom For My People) 38 Rattle & Hum. (The Star Spangled Banner) 43 Boy. The Ocean 94 Boy. Into the Heart 113 The Unforgettable Fire. 4th Of July 135 October. October 141 War. Two Hearts Beat As One 141 The Unforgettable Fire. Promenade 152 The Unforgettable Fire. MLK 152 Under A Blood Red Sky. Party Girl 172 October. Scarlet 173 War. 40 173 The Joshua Tree. In God's Country 177 Rattle & Hum. Desire 179 October. Is That All? 180 Boy. Stories for Boys 182 Rattle & Hum. Van Diemen's Land 186 Rattle & Hum. Helter Skelter 187 Boy. A Day Without Me 194 Rattle & Hum. God Part II 195 The Joshua Tree. Trip Through Your Wires 212 Boy. I Will Follow 216 Under A Blood Red Sky. I Will Follow 216 Under A Blood Red Sky. 40 216 October. Rejoice 218 War. Like A Song... 218 October. I Fall Down 219 War. Seconds 219 Achtung Baby. Even Better Than The Real Thing 221 Zooropa. The First Time 225 Rattle & Hum. Angel Of Harlem 229 The Unforgettable Fire. Pride (In The Name Of Love) 229 October. Fire 231 War. Drowning Man 231 Achtung Baby. Tryin' To Throw Your Arms Around The World 233 October. Stranger In A Strange Land 237 War. Surrender 237 Zooropa. Babyface 240 October. With A Shout (Jerusalem) 243 War. Red Light 243 Achtung Baby. Mysterious Ways 244 Boy. Out of Control 253 October. Gloria 253 The Joshua Tree. Exit 253 War. Sunday Bloody Sunday 253 Rattle & Hum. When Love Comes To Town 254 Zooropa. Some Days Are Better Than Others 255 The Joshua Tree. Running To Stand Still 258 The Unforgettable Fire. Indian Summer Sky 258 Zooropa. Numb 258 The Unforgettable Fire. Wire 259 Boy. Twilight 262 Achtung Baby. Love Is Blindness 263 Rattle & Hum. All Along The Watchtower 264 Pop. Gone 266 Rattle & Hum. Pride (In The Name Of Love) 267 Achtung Baby. The Fly 269 Under A Blood Red Sky. New Year's Day 269 Achtung Baby. Acrobat 270 The Joshua Tree. Bullet The Blue Sky 272 Under A Blood Red Sky. Gloria 272 Boy. Another Time, Another Place 274 Under A Blood Red Sky. 11 O'Clock Tick Tock 274 Achtung Baby. Zoo Station 276 Achtung Baby. One 276 Boy. Shadows and Tall Trees 276 Pop. Staring At The Sun 276 The Joshua Tree. I Still Haven't Found What I'm Looking For 277 Achtung Baby. Until The End Of The World 279 October. Tomorrow 279 War. The Refugee * 279 Pop. The Playboy Mansion 280 Zooropa. The Wanderer 284 Pop. Last Night On Earth 285 Boy. The Electric Co. 288 Pop. Miami 292 Pop. Wake Up Dead Man 292 The Joshua Tree. Red Hill Mining Town 292 October. I Threw A Brick Through A Window 295 The Unforgettable Fire. The Unforgettable Fire 295 Under A Blood Red Sky. Sunday Bloody Sunday 295 War. New Year's Day 295 The Joshua Tree. With Or Without You 296 Zooropa. Stay (Faraway, So Close!) 298 Pop. Please 302 Rattle & Hum. Heartland 302 Pop. Do You Feel Loved 307 The Joshua Tree. Mothers Of The Disappeared 314 Pop. If You Wear That Velvet Dress 315 Achtung Baby. Who's Gonna Ride Your Wild Horses 316 Under A Blood Red Sky. The Electric Co. 318 Pop. Discotheque 319 Zooropa. Daddy's Gonna Pay For Your Crashed Car 319 Pop. If God Will Send His Angels 322 The Joshua Tree. One Tree Hill 323 Zooropa. Dirty Day 324 The Unforgettable Fire. A Sort Of Homecoming 329 Achtung Baby. Ultraviolet (Light My Way) 331 Rattle & Hum. Bullet The Blue Sky 337 The Joshua Tree. Where The Streets Have No Name 337 Achtung Baby. So Cruel 349 Pop. Mofo 349 Rattle & Hum. Silver and Gold 350 Rattle & Hum. I Still Haven't Found What I'm Looking For 353 The Unforgettable Fire. Bad 369 Boy. An Cat Dubh 381 Rattle & Hum. Hawkmoon 269 382 The Unforgettable Fire. Elvis Presley and America 382 Rattle & Hum. Love Rescue Me 383 Rattle & Hum. All I Want Is You 390 Zooropa. Zooropa 390 Zooropa. Lemon 416 > > > > cleanEx(); ..nameEx <- "urchin.growth" > > ### * urchin.growth > > flush(stderr()); flush(stdout()) > > ### Name: urchin.growth > ### Title: Data on growth of sea urchins > ### Aliases: urchin.growth > ### Keywords: datasets > > ### ** Examples > > data(urchin.growth) > plot(jitter(size) ~ jitter(age), data=urchin.growth) > > > > cleanEx(); ..nameEx <- "yellowfin" > > ### * yellowfin > > flush(stderr()); flush(stdout()) > > ### Name: yellowfin > ### Title: Yellow fin tuna catch rate in Tropical Indian Ocean > ### Aliases: yellowfin > ### Keywords: datasets > > ### ** Examples > > data(yellowfin) > plot(yellowfin) > > > > ### *