diff --git a/R/legTools.R b/R/legTools.R index 1302641f0c16b908059c599420ab21817f073fb7..9dde2813d07f3c782c3b371a51eb4e67f50a25db 100644 --- a/R/legTools.R +++ b/R/legTools.R @@ -247,3 +247,42 @@ NULL #' xlab="Variety") #' NULL + +#' @name sugarcaneYield +#' +#' @title Sugarcane variety experiment +#' +#' @description These data are from an experiment done by The West São +#' Paulo State Sugar Mills Cooperative. The experiment was done in a +#' randomized complete block design with 4 blocks. Sugarcane yield +#' (kg/plot) was recorded in each experimental unit. +#' +#' \itemize{ +#' \item \code{block} a categorical unordered factor with 4 levels. +#' \item \code{variety} a categorical unordered factor with 7 +#' levels. +#' \item \code{yield} sugarcane yield (kg/plot). +#' } +#' +#' @docType data +#' +#' @keywords datasets +#' +#' @usage data(sugarcaneYield) +#' +#' @format a \code{data.frame} with 28 records and 3 variables. +#' +#' @source Frederico, P. (2009). Curso de Estatística Experimental (15th +#' ed.). Piracicaba, São Paulo: FEALQ. (page 92) +#' +#' @examples +#' +#' require(lattice) +#' data(sugarcaneYield) +#' +#' plot(yield~variety, data=sugarcaneYield, +#' groups=block, type="o", +#' ylab=expression(Yield~(kg~plot^{-1})), +#' xlab="Variety") +#' +NULL diff --git a/data-raw/sugarcaneYield.R b/data-raw/sugarcaneYield.R new file mode 100644 index 0000000000000000000000000000000000000000..13f0c6517f73c8c363fcf78d04212e484880c7a1 --- /dev/null +++ b/data-raw/sugarcaneYield.R @@ -0,0 +1,26 @@ +##---------------------------------------------------------------------- +## Data generation. + +sugarcaneYield <- read.table("http://www.leg.ufpr.br/~walmes/data/pimentel_canadeacucar1.txt", + header=TRUE, sep="\t") +names(sugarcaneYield) <- c("block", "variety", "yield") +str(sugarcaneYield) + +sugarcaneYield <- sugarcaneYield[with(sugarcaneYield, order(block, variety)),] + +save(sugarcaneYield, file="../data/sugarcaneYield.RData") + +##---------------------------------------------------------------------- +## Examples. + +require(lattice) + +xyplot(yield~variety, data=sugarcaneYield, + groups=block, type="o", + ylab=expression(Yield~(kg~plot^{-1})), + xlab="Variety") + +rm(list=ls()) +load("../data/sugarcaneYield.RData") +ls() +str(sugarcaneYield) diff --git a/data/sugarcaneYield.RData b/data/sugarcaneYield.RData new file mode 100644 index 0000000000000000000000000000000000000000..ed83ef19f70e11e971cd8111b50669ad97e383ac Binary files /dev/null and b/data/sugarcaneYield.RData differ diff --git a/man/sugarcaneYield.Rd b/man/sugarcaneYield.Rd new file mode 100644 index 0000000000000000000000000000000000000000..6a6983f30e78d5cac0404f5bef182b165014f0df --- /dev/null +++ b/man/sugarcaneYield.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/legTools.R +\docType{data} +\name{sugarcaneYield} +\alias{sugarcaneYield} +\title{Sugarcane variety experiment} +\format{a \code{data.frame} with 28 records and 3 variables.} +\source{ +Frederico, P. (2009). Curso de Estatística Experimental (15th + ed.). Piracicaba, São Paulo: FEALQ. (page 92) +} +\usage{ +data(sugarcaneYield) +} +\description{ +These data are from an experiment done by The West São + Paulo State Sugar Mills Cooperative. The experiment was done in a + randomized complete block design with 4 blocks. Sugarcane yield + (kg/plot) was recorded in each experimental unit. + +\itemize{ + \item \code{block} a categorical unordered factor with 4 levels. + \item \code{variety} a categorical unordered factor with 7 + levels. + \item \code{yield} sugarcane yield (kg/plot). +} +} +\examples{ +require(lattice) +data(sugarcaneYield) + +plot(yield~variety, data=sugarcaneYield, + groups=block, type="o", + ylab=expression(Yield~(kg~plot^{-1})), + xlab="Variety") +} +\keyword{datasets} +