Skip to content
Snippets Groups Projects
Commit a013a775 authored by Walmes Zeviani's avatar Walmes Zeviani
Browse files

Add dataset from acidity of mango fruits per variety.

parent 130b993f
No related branches found
No related tags found
No related merge requests found
##----------------------------------------------------------------------
## Data generation.
mangoAcidity <- expand.grid(variety=c("Bourbon", "Brasil", "Extrema",
"Maçã", "Non Plus Ultra",
"Oliveira"),
year=c(1957:1959),
month=c("N", "D", "J"),
KEEP.OUT.ATTRS=FALSE)
mangoAcidity$acid <- c(28.2, 38.3, 37.6, 47.2, 36.4, 40.0, 24.7, 32.0,
39.0, 47.7, 35.3, 30.1, 16.4, 38.4, 50.3, 50.2,
40.1, 30.0, 6.0, 5.0, 6.0, 6.2, 7.9, 6.0, 6.2,
3.6, 6.6, 6.9, 10.2, 7.0, 6.9, 4.0, 6.9, 7.9,
9.8, 8.4, 4.6, 4.6, 5.4, 5.2, 4.9, 6.1, 4.4,
4.2, 5.4, 4.2, 6.8, 3.5, 5.0, 3.8, 5.0, 5.0,
7.0, 4.8)
str(mangoAcidity)
save(mangoAcidity, file="../data/mangoAcidity.RData")
##----------------------------------------------------------------------
## Examples.
library(lattice)
library(latticeExtra)
data(mangoAcidity)
str(mangoAcidity)
## reshape::cast() can also be used.
with(mangoAcidity,
ftable(tapply(acid,
list(variety, year, month),
FUN=identity)))
xyplot(acid~month|variety, groups=year,
data=mangoAcidity, type=c("p", "a"),
auto.key=TRUE,
ylab="Acidity",
xlab="Month")
rm(list=ls())
load("../data/mangoAcidity.RData")
ls()
str(mangoAcidity)
File added
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/legTools.R
\docType{data}
\name{mangoAcidity}
\alias{mangoAcidity}
\title{Acidity of mango fruits by varieties, years and months}
\format{a \code{data.frame} with 54 records and 6 variables.}
\source{
Frederico, P. (2009). Curso de Estatística Experimental (15th
ed.). Piracicaba, São Paulo: FEALQ. (page 132)
Simão, S. (1960). Estudo da planta e dos frutos da mangueira
(\emph{Manginifera indica} L.). Piracicaba, 1960. Thesis.
}
\usage{
data(sugarcaneYield4)
}
\description{
These data are from an observational study along 3 years
where acidity in fruits of 6 varieties of mango was determined in
Novermber, December and January.
\itemize{
\item \code{variety} a categorical variable with 6 levels that
represents mango varieties studied.
\item \code{year} the year of harvesting.
\item \code{month} the month of harvesting.
\item \code{acid} mean of the acidity determined in 3 fruits.
}
}
\examples{
library(lattice)
library(latticeExtra)
data(mangoAcidity)
str(mangoAcidity)
## reshape::cast() can also be used.
with(mangoAcidity,
ftable(tapply(acid,
list(variety, year, month),
FUN=identity)))
xyplot(acid~month|variety, groups=year,
data=mangoAcidity, type=c("p", "a"),
auto.key=TRUE,
ylab="Acidity",
xlab="Month")
}
\keyword{datasets}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment