From 9d0b06712b6b93402fe3507bb1530b6bf7737101 Mon Sep 17 00:00:00 2001
From: Walmes Zeviani <walmeszeviani@gmail.com>
Date: Wed, 12 Aug 2015 20:15:21 -0300
Subject: [PATCH] add files for the first dataset.

---
 R/legTools.R      |  38 ++++++++++++++++++++++++++++++++++++++
 data-raw/wgpigs.R |  19 +++++++++++++++++++
 data/wgpigs.rda   | Bin 0 -> 219 bytes
 man/wgpigs.Rd     |  36 ++++++++++++++++++++++++++++++++++++
 4 files changed, 93 insertions(+)
 create mode 100644 data-raw/wgpigs.R
 create mode 100644 data/wgpigs.rda
 create mode 100644 man/wgpigs.Rd

diff --git a/R/legTools.R b/R/legTools.R
index f500c35..5e38423 100644
--- a/R/legTools.R
+++ b/R/legTools.R
@@ -6,3 +6,41 @@
 ##' @docType package
 ##' @name legTools
 NULL
+
+#' @title Feeding type in pig weight gain
+#' 
+#' @description This is an artifial dataset corresponding a experiment
+#' to study the effect of feeding type (factor with 4 categorical
+#' nominal levels) in pig weight gain. The experiment was a randomized
+#' complete design with five experimental units per treatment level. The
+#' experimental unit was a pig. The response measured was weight gain from
+#' the beggining to the end of the experiment.
+#'
+#' \itemize{
+#'     \item ft feeding type, a categorical factor with 4 levels.
+#'     \item wg weight gain (kg).
+#' }
+#'
+#' @docType data
+#' 
+#' @keywords datasets
+#' 
+#' @name wgpigs
+#' 
+#' @usage data(wgpigs)
+#' 
+#' @format a \code{data.frame} with 20 records and 2 variables.
+#'
+#' @source Frederico, P. (2009). Curso de Estatística Experimental (15th
+#' ed.). Piracicaba, São Paulo: FEALQ.
+#'
+#' @examples
+#' 
+#' require(lattice)
+#' 
+#' xyplot(wg~ft, data=wgpigs,
+#'        ylab="Weight gain (kg)",
+#'        xlab="Feeding type")
+#'
+#' @export
+NULL
diff --git a/data-raw/wgpigs.R b/data-raw/wgpigs.R
new file mode 100644
index 0000000..5f74783
--- /dev/null
+++ b/data-raw/wgpigs.R
@@ -0,0 +1,19 @@
+##----------------------------------------------------------------------
+## Data generation.
+
+da <- read.table("http://www.leg.ufpr.br/~walmes/data/pimentel_racoes.txt",
+                 header=TRUE, sep="\t")
+names(da) <- c("ft","wg")
+str(da)
+
+save(da, file="../data/wgpigs.rda")
+wgpigs <- da
+
+##----------------------------------------------------------------------
+## Examples.
+
+require(lattice)
+
+xyplot(wg~ft, data=wgpigs,
+       ylab="Weight gain (kg)",
+       xlab="Feeding type")
diff --git a/data/wgpigs.rda b/data/wgpigs.rda
new file mode 100644
index 0000000000000000000000000000000000000000..2955c8151ea377cbcebe4f00f7f9b3ef30b404ef
GIT binary patch
literal 219
zcmV<103`n(iwFP!0000018tB^4uUWcg@+bRBpOY0=U<Eqbs-CHpmG9NY#RkPs0k3+
zdSK50KA>a5&*E!er=2%5y*Tc{axEefB!xjjLYe}LK_>O`_)QVXaq)uW0Q;o4Z6aEb
zEtpLz6}y4=_JRm%RNR(P<H+K~;>^OSIdrapirC<9>#J-03ZYWKgRDV5+!74I0&I2M
z20O3<8!**5bFkOvzV@1xxz#qF>fv!4g8$QxSta)}L1wj9t(%IK?T1LOS@yzLVzX^t
VSA4K!S@zX)r9ao@Gttrk003F<W=jA7

literal 0
HcmV?d00001

diff --git a/man/wgpigs.Rd b/man/wgpigs.Rd
new file mode 100644
index 0000000..fa6aa5f
--- /dev/null
+++ b/man/wgpigs.Rd
@@ -0,0 +1,36 @@
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/legTools.R
+\docType{data}
+\name{wgpigs}
+\alias{wgpigs}
+\title{Feeding type in pig weight gain}
+\format{a \code{data.frame} with 20 records and 2 variables.}
+\source{
+Frederico, P. (2009). Curso de Estatística Experimental (15th
+ed.). Piracicaba, São Paulo: FEALQ.
+}
+\usage{
+data(wgpigs)
+}
+\description{
+This is an artifial dataset corresponding a experiment
+to study the effect of feeding type (factor with 4 categorical
+nominal levels) in pig weight gain. The experiment was a randomized
+complete design with five experimental units per treatment level. The
+experimental unit was a pig. The response measured was weight gain from
+the beggining to the end of the experiment.
+
+\itemize{
+    \item ft feeding type, a categorical factor with 4 levels.
+    \item wg weight gain (kg).
+}
+}
+\examples{
+require(lattice)
+
+xyplot(wg~ft, data=wgpigs,
+       ylab="Weight gain (kg)",
+       xlab="Feeding type")
+}
+\keyword{datasets}
+
-- 
GitLab