Add final grades.

parent 9c6021e1
......@@ -89,7 +89,7 @@ x <- gdata::read.xls(paste0(path, "RelatoriodeDiariodeClasseExcel.xls"),
encoding = "latin1",
stringsAsFactors = FALSE,
skip = 6)
v <- names(x) %in% c("Matrícula", "Nome", "Faltas")
v <- names(x) %in% c("Matrícula", "Nome", "Faltas", "Exame")
mat <- x %>%
select(names(x)[v]) %>%
......@@ -276,7 +276,16 @@ nt %>%
nt <- nt %>%
filter(!is.na(GRR)) %>%
arrange(GRR)
# View(arrange(nt, nome))
if (!is.null(nt$Exame)) {
nt[["M. final"]] <- nt[["Média"]]
i <- nt[["Média"]] < 70 & nt[["Média"]] >= 40
u <- nt[["Exame"]]
u[is.na(u)] <- 0
nt[["M. final"]][i] <- ceiling((nt[["Média"]][i] + u[i])/2)
}
# View(nt)
#-----------------------------------------------------------------------
# Tabela em HTML.
......@@ -288,11 +297,17 @@ if (require(htmltools)) {
cap <- HTML("<strong>Tabela 1</strong>:", cap)
}
i <- c(grep(x = names(nt), "GRR"),
grep(x = names(nt), "^S"),
grep(x = names(nt), "^T"),
grep(x = names(nt), "Faltas"),
grep(x = names(nt), "Média"))
# i <- c(grep(x = names(nt), "GRR"),
# grep(x = names(nt), "^S"),
# grep(x = names(nt), "^T"),
# grep(x = names(nt), "Faltas"),
# grep(x = names(nt), "Exame"),
# grep(x = names(nt), "Média"))
i <- c(grep(x = names(nt), "nome"),
grep(x = names(nt), "Média"),
grep(x = names(nt), "Exame"),
grep(x = names(nt), "M. final"))
dt <- datatable(data = select(nt, i),
filter = "top",
......@@ -323,6 +338,14 @@ if (is.element("Faltas", names(dt$x$data))) {
"#ff3300")))
}
if (is.element("M. final", names(dt$x$data))) {
dt <- formatStyle(table = dt,
columns = "M. final",
color = styleInterval(cuts = c(49.999999),
values = c("#ff3300",
"#3333ff")))
}
dt
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment