diff --git a/R/CharnetEx1.18.R b/R/CharnetEx1.18.R index 91047193e344006ffedd793606192a7c257ba423..a4e5584a7f010739ca585929eee4e8cc017d595a 100644 --- a/R/CharnetEx1.18.R +++ b/R/CharnetEx1.18.R @@ -1,9 +1,9 @@ #' @name CharnetEx1.18 #' -#' @title Tempo e temperatura de uma reação química +#' @title Tempo e Temperatura de uma Reação Química #' -#' @description Registro de 35 tempos de reação química em 7 -#' temperaturas diferentes +#' @description Registro de 35 tempos de reação química em 7 +#' temperaturas diferentes. #' #' @format Um \code{data.frame} com 2 colunas e 35 linhas. #' @@ -26,6 +26,23 @@ #' #' data(CharnetEx1.18) #' -#' plot(CharnetEx1.18) -#' -NULL \ No newline at end of file +#' library(ggplot2) +#' +#' with(CharnetEx1.18, { +#' mu <- aggregate(tempo, list(temp), mean) +#' des <- aggregate(tempo, list(temp), sd) +#' (da <<- data.frame(x = mu$G, mu = mu$x, sd = des$x)) +#' }) +#' +#' ggplot(CharnetEx1.18, aes(x = temp, y = tempo)) + +#' geom_point() + +#' geom_point( +#' aes(x = x - 1, y = mu), data = da, +#' col = 4, shape = 15, size = 2.5) + +#' geom_segment( +#' aes(x = x - 1, y = mu - sd, xend = x - 1, yend = mu + sd), +#' arrow = arrow(angle = 90, length = unit(0.05, "inches"), +#' ends = "both"), data = da, col = 4) + +#' geom_smooth(method = "lm", se = FALSE) +#' +NULL diff --git a/man/CharnetEx1.18.Rd b/man/CharnetEx1.18.Rd new file mode 100644 index 0000000000000000000000000000000000000000..4ead5ee48ebde920f61edf4393c4419fcc732f8b --- /dev/null +++ b/man/CharnetEx1.18.Rd @@ -0,0 +1,50 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/CharnetEx1.18.R +\name{CharnetEx1.18} +\alias{CharnetEx1.18} +\title{Tempo e Temperatura de uma Reação Química} +\format{Um \code{data.frame} com 2 colunas e 35 linhas. + +\describe{ + +\item{\code{temp}}{Temperatura em graus Celsius} + +\item{\code{tempo}}{Tempo de reação, em segundos} + +}} +\source{ +Charnet, R., de Luna Freire, C.A., Charnet, E.M.R. & Bonvino, + H. (2008). Análise de modelos de regressão linear com aplicações + (2nd ed., p. 356). SP: Editora Unicamp (Capítulo 1, exercício 18, + página 25) +} +\description{ +Registro de 35 tempos de reação química em 7 + temperaturas diferentes. +} +\examples{ + +data(CharnetEx1.18) + +library(ggplot2) + +with(CharnetEx1.18, { + mu <- aggregate(tempo, list(temp), mean) + des <- aggregate(tempo, list(temp), sd) + (da <<- data.frame(x = mu$G, mu = mu$x, sd = des$x)) +}) + +ggplot(CharnetEx1.18, aes(x = temp, y = tempo)) + + geom_point() + + geom_point( + aes(x = x - 1, y = mu), data = da, + col = 4, shape = 15, size = 2.5) + + geom_segment( + aes(x = x - 1, y = mu - sd, xend = x - 1, yend = mu + sd), + arrow = arrow(angle = 90, length = unit(0.05, "inches"), + ends = "both"), data = da, col = 4) + + geom_smooth(method = "lm", se = FALSE) + +} +\keyword{TODO} +