diff --git a/10-fatorial-duplo-1-adicional.Rmd b/10-fatorial-duplo-1-adicional.Rmd new file mode 100644 index 0000000000000000000000000000000000000000..b8d4f88bc075ef96f37ea6f448ed4c226e392d0e --- /dev/null +++ b/10-fatorial-duplo-1-adicional.Rmd @@ -0,0 +1,39 @@ +# Fatorial duplo com um tratamento adicional + +```{r, eval = FALSE} +library(labestData) + +ls("package:labestData") + +tb <- expand.grid(NR = c("Baixo", "Convencional"), + Fitato = c("Alto", "Médio"), + Fitase = c(0, 750, 1500)) +tb <- tb[with(tb, !(NR == "Convencional" & Fitase > 0)), ] +ftable(xtabs(~NR + Fitato + Fitase, data = tb)) +``` + +```{r, message = FALSE} +library(tidyverse) +``` +```{r} +# Importação dados dados. +tb <- read_tsv("./data-raw/fat2x3+2adic.txt", + comment = "#", + col_types = cols()) +attr(tb, "spec") <- NULL +str(tb) + +# Criando o fator NR. +tb$nr <- "Baixo" +tb$nr[with(tb, tratamento %in% c(1, 5))] <- "Convencional" + +# Contagem das ocorrências dos pontos experimentais. +ftable(xtabs(~nr + fitato + fitase, data = tb)) + +# Análise exploratória. +ggplot(data = tb, + mapping = aes(x = fitase, y = cdaeb, color = nr)) + + facet_wrap(facets = ~fitato) + + geom_point() + + stat_summary(geom = "line", fun.y = "mean") +```