textInput("NIU", "NIU:", "100..."),
actionButton("go", "Go!"),
verbatimTextOutput('summaryLM'),
plotOutput('plotLM')
)
render = function(input, output) {
grades <- eventReactive(input$go, {
read_csv(input$file$datapath)
})
linealModel <- reactive({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
lm( FINAL ~ CONTINUOUS)
})
output$summaryLM <- renderPrint({
summary(linealModel())
})
output$plotLM <- renderPlot({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
prediction <- predict(linealModel(), CONTINUOUS[which(data.matrix(grades()[,1]) == input$NIU)])
#if(prediction[which(grades()[,1] == input$NIU)]<5){idcol <- 'red'}else{idcol <- 'green'}
plot(CONTINUOUS, FINAL, ylab = 'Final Grade', xlab = 'Continuous Assessment')
abline(linealModel())
abline(h = 5, lty = 2)
#points(CONTINUOUS[which(data.matrix(grades()[,1])==input$NIU)], prediction[which(data.matrix(grades()[,1]) == input$NIU)], col=idcol , lwd=4)
})
}
shinyApp(ui = ui, render)
prediction <- predict(linealModel(), CONTINUOUS[which(data.matrix(grades[,1]) == grades[1,1])])
prediction <- predict(model, CONTINUOUS[which(data.matrix(grades[,1]) == grades[1,1])])
CONTINUOUS[which(data.matrix(grades[,1]) == grades[1,1])]
prediction <- predict(model,7-38)
prediction <- predict(model,7,38)
prediction <- predict(model,7.38)
library('shiny')
library('DT')
library('readr')
library('vioplot')
ui = fluidPage(
fileInput('file', 'Choose .CSV', accept = "text/csv",  placeholder = "No file selected"),
textInput("NIU", "NIU:", "100..."),
actionButton("go", "Go!"),
verbatimTextOutput('summaryLM'),
plotOutput('plotLM')
)
render = function(input, output) {
grades <- eventReactive(input$go, {
read_csv(input$file$datapath)
})
linealModel <- reactive({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
lm( FINAL ~ CONTINUOUS)
})
output$summaryLM <- renderPrint({
summary(linealModel())
})
output$plotLM <- renderPlot({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
prediction <- predict(linealModel(), CONTINUOUS[which(data.matrix(grades()[,1]) == input$NIU)])
#if(prediction[which(grades()[,1] == input$NIU)]<5){idcol <- 'red'}else{idcol <- 'green'}
plot(CONTINUOUS, FINAL, ylab = 'Final Grade', xlab = 'Continuous Assessment')
abline(linealModel())
abline(h = 5, lty = 2)
#points(CONTINUOUS[which(data.matrix(grades()[,1])==input$NIU)], prediction[which(data.matrix(grades()[,1]) == input$NIU)], col=idcol , lwd=4)
})
}
shinyApp(ui = ui, render)
library('shiny')
library('DT')
library('readr')
library('vioplot')
ui = fluidPage(
fileInput('file', 'Choose .CSV', accept = "text/csv",  placeholder = "No file selected"),
textInput("NIU", "NIU:", "100..."),
actionButton("go", "Go!"),
verbatimTextOutput('summaryLM'),
plotOutput('plotLM')
)
render = function(input, output) {
grades <- eventReactive(input$go, {
read_csv(input$file$datapath)
})
linealModel <- reactive({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
lm( FINAL ~ CONTINUOUS)
})
output$summaryLM <- renderPrint({
summary(linealModel())
})
output$plotLM <- renderPlot({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
prediction <- predict(linealModel(), CONTINUOUS[which(data.matrix(grades()[,1]) == input$NIU)])
if(prediction[which(grades()[,1] == input$NIU)]<5){idcol <- 'red'}else{idcol <- 'green'}
plot(CONTINUOUS, FINAL, ylab = 'Final Grade', xlab = 'Continuous Assessment')
abline(linealModel())
abline(h = 5, lty = 2)
#points(CONTINUOUS[which(data.matrix(grades()[,1])==input$NIU)], prediction[which(data.matrix(grades()[,1]) == input$NIU)], col=idcol , lwd=4)
})
}
shinyApp(ui = ui, render)
library('shiny')
library('DT')
library('readr')
library('vioplot')
ui = fluidPage(
fileInput('file', 'Choose .CSV', accept = "text/csv",  placeholder = "No file selected"),
textInput("NIU", "NIU:", "100..."),
actionButton("go", "Go!"),
verbatimTextOutput('summaryLM'),
plotOutput('plotLM')
)
render = function(input, output) {
grades <- eventReactive(input$go, {
read_csv(input$file$datapath)
})
linealModel <- reactive({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
lm( FINAL ~ CONTINUOUS)
})
output$summaryLM <- renderPrint({
summary(linealModel())
})
output$plotLM <- renderPlot({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
prediction <- predict(linealModel(), CONTINUOUS[which(data.matrix(grades()[,1]) == input$NIU)])
if(prediction[which(grades()[,1] == input$NIU)]<5){idcol <- 'red'}else{idcol <- 'green'}
plot(CONTINUOUS, FINAL, ylab = 'Final Grade', xlab = 'Continuous Assessment')
abline(linealModel())
abline(h = 5, lty = 2)
points(CONTINUOUS[which(data.matrix(grades()[,1])==input$NIU)], prediction[which(data.matrix(grades()[,1]) == input$NIU)], col=idcol , lwd=4)
})
}
shinyApp(ui = ui, render)
library('shiny')
library('DT')
library('readr')
library('vioplot')
ui = fluidPage(
fileInput('file', 'Choose .CSV', accept = "text/csv",  placeholder = "No file selected"),
textInput("NIU", "NIU:", "100..."),
actionButton("go", "Go!"),
radioButtons('varInterest', 'Analisys of:', choices =c('continuousAssessment', 'finalGrade'), selected = 'continuousAssessment'),
radioButtons('categorical', 'By', choices =c('gender', 'highSchoolTrack'), selected = 'gender'),
sliderInput('samplesize', 'Sample Size', min = 10, max = 50, value =30),
numericInput('realizations', 'Number of Samples', value = 50),
plotOutput('plotComparison')
)
render = function(input, output) {
grades <- eventReactive(input$go, {
read_csv(input$file$datapath)
})
output$plotComparison <- renderPlot({
replicates <- input$realizations
samplesize <- input$samplesize
varClass <- na.omit(grades()[!is.na(grades()[,input$varInterest]),input$categorical])
var <- data.matrix(na.omit(grades()[,input$varInterest]))
classes <- unique(varClass)
sampling <- matrix(NA, nrow=replicates, ncol=2)
for(i in c(1:replicates)){
sampling[i,1] <- mean(var[sample(which(varClass == classes[[1]][1]), samplesize, replace=TRUE)])
sampling[i,2] <- mean(var[sample(which(varClass == classes[[1]][2]), samplesize, replace=TRUE)])
}
hist(sampling[,1], ylim=c(0,30), xlim=c(min(c(sampling))-2,max(c(sampling))+2), col='red', xlab = as.character(input$varInterest))
hist(sampling[,2], col='blue', add = TRUE)
abline(v = c(mean(sampling[,1])-2.26*sd(sampling[,1])/sqrt(samplesize),mean(sampling[,1])+2.26*sd(sampling[,1])/sqrt(samplesize)), col='red', lwd=3)
abline(v = c(mean(sampling[,2])-2.26*sd(sampling[,2])/sqrt(samplesize),mean(sampling[,2])+2.26*sd(sampling[,2])/sqrt(samplesize)), col='blue', lwd=3)
})
}
shinyApp(ui = ui, render)
library(shiny)
ui <- fluidPage(
sliderInput(inputId = "bins",
label = "Number of bins:",
min = 1,
max = 50,
value = 30),
verbatimTextOutput('summary'),
plotOutput(outputId = "histogram"),
plotOutput(outputId = "barplot")
)
server = function(input, output) {
grades <- reactive({
read_csv('grades.csv')
})
output$summary <- renderPrint({
summary(grades())
})
output$histogram <- renderPlot({
hist(grades()$continuousAssessment, breaks = input$bins)
})
output$barplot <- renderPlot({
barplot(table(grades()$highSchoolTrack))
})
}
shinyApp(ui, server)
library(shiny)
library(readr)
ui <- fluidPage(
sliderInput(inputId = "bins",
label = "Number of bins:",
min = 1,
max = 50,
value = 30),
verbatimTextOutput('summary'),
plotOutput(outputId = "histogram"),
plotOutput(outputId = "barplot")
)
server = function(input, output) {
grades <- reactive({
read_csv('grades.csv')
})
output$summary <- renderPrint({
summary(grades())
})
output$histogram <- renderPlot({
hist(grades()$continuousAssessment, breaks = input$bins)
})
output$barplot <- renderPlot({
barplot(table(grades()$highSchoolTrack))
})
}
shinyApp(ui, server)
qt(0.05,99)
qt(0.025,99)
qt(0.025,29)
qt(0.005,29)
qt(0.005,99)
library(shiny)
library(readr)
ui <- fluidPage(
)
server = function(input, output) {
grades <- read_csv('grades.csv')
output$table <- renderTable({
head(grades)
})
}
shinyApp(ui, server)
library(shiny)
library(readr)
ui <- fluidPage(
plotOutput('table')
)
server = function(input, output) {
grades <- read_csv('grades.csv')
output$table <- renderTable({
head(grades)
})
}
shinyApp(ui, server)
getwd()
library(shiny)
library(readr)
ui <- fluidPage(
tableOutput('table')
)
server = function(input, output) {
grades <- read_csv('grades.csv')
output$table <- renderTable({
head(grades)
})
}
shinyApp(ui, server)
library(shiny)
library(readr)
ui <- fluidPage(
tableOutput('table')
)
server = function(input, output) {
grades <- read_csv('grades.csv')
output$table <- renderTable({
head(grades)
})
}
shinyApp(ui, server)
library(shiny)
library(readr)
ui <- fluidPage(
tableOutput('table')
)
server = function(input, output) {
grades <- reactice({
read_csv('grades.csv')
})
output$table <- renderTable({
head(grades)
})
}
shinyApp(ui, server)
library(shiny)
library(readr)
ui <- fluidPage(
tableOutput('table')
)
server = function(input, output) {
grades <- reactive({
read_csv('grades.csv')
})
output$table <- renderTable({
head(grades)
})
}
shinyApp(ui, server)
library(shiny)
library(readr)
ui <- fluidPage(
tableOutput('table')
)
server = function(input, output) {
grades <- reactive({
read_csv('grades.csv')
})
output$table <- renderTable({
head(grades())
})
}
shinyApp(ui, server)
grades
read_csv('grades.csv')
help("read_csv")
library(readr)
grades <- read_csv("grades.csv")
View(grades)
DT::dataTable(grades)
options(shiny.reactlog=TRUE)
source('C:/Users/Antonioefz/Desktop/2018-10-16-shiny2/studentGrades-App0/main.R')
getwd()
setwd("C:/Users/Antonioefz/Desktop/2018-10-16-shiny2/studentGrades-App0")
#packages
library(DT)
library(shiny)
library(readr)
library(knitr)
library(vioplot)
#run the app if the App code is at the working directory
runApp()
#packages
library(DT)
library(shiny)
library(readr)
library(knitr)
library(vioplot)
#run the app if the App code is at the working directory
runApp()
runApp()
source('main.R')
source('main.R')
runApp()
FINAL <- data.matrix(grades[,7])
CONTINUOUS <- data.matrix(grades[,5])
CONTINUOUS
CONTINUOUS[1,]
CONTINUOUS[1]
linealModel <- lm(FINAL ~ CONTINUOUS)
predict(linealMode, CONTINUOUS[which(data.matrix(grades[,1]) == input$NIU)])
predict(linealModel, CONTINUOUS[which(data.matrix(grades[,1]) == input$NIU)])
predict(linealModel, CONTINUOUS[which(data.matrix(grades[,1]) == grades[1,1])])
which(data.matrix(grades[,1]) == grades[1,1])
CONTINUOUS[which(data.matrix(grades[,1]) == grades[1,1])]
predict(linealModel, 7.38)
linealModel
predict(linealModel, CONTINUOUS)
source('main.R')
library('shiny')
library('DT')
library('readr')
library('vioplot')
ui = fluidPage(
fileInput('file', 'Choose .CSV', accept = "text/csv",  placeholder = "No file selected"),
textInput("NIU", "NIU:", "100..."),
actionButton("go", "Go!"),
verbatimTextOutput('summaryLM'),
plotOutput('plotLM')
)
render = function(input, output) {
grades <- eventReactive(input$go, {
read_csv(input$file$datapath)
})
linealModel <- reactive({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
lm( FINAL ~ CONTINUOUS)
})
output$summaryLM <- renderPrint({
summary(linealModel())
})
output$plotLM <- renderPlot({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
prediction <- predict(linealModel(), CONTINUOUS[which(data.matrix(grades()[,1]) == input$NIU)])
if(prediction[which(grades()[,1] == input$NIU)]<5){idcol <- 'red'}else{idcol <- 'green'}
plot(CONTINUOUS, FINAL, ylab = 'Final Grade', xlab = 'Continuous Assessment')
abline(linealModel())
abline(h = 5, lty = 2)
points(CONTINUOUS[which(data.matrix(grades()[,1])==input$NIU)], prediction[which(data.matrix(grades()[,1]) == input$NIU)], col=idcol , lwd=4)
})
}
shinyApp(ui = ui, render)
grades <- eventReactive(input$go, {
read_csv(input$file$datapath)
})
linealModel <- reactive({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
lm( FINAL ~ CONTINUOUS)
})
output$summaryLM <- renderPrint({
summary(linealModel())
})
output$plotLM <- renderPlot({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
prediction <- predict(linealModel(), CONTINUOUS[which(data.matrix(grades()[,1]) == input$NIU)])
if(prediction[which(grades()[,1] == input$NIU)]<5){idcol <- 'red'}else{idcol <- 'green'}
plot(CONTINUOUS, FINAL, ylab = 'Final Grade', xlab = 'Continuous Assessment')
abline(linealModel())
abline(h = 5, lty = 2)
points(CONTINUOUS[which(data.matrix(grades()[,1])==input$NIU)], prediction[which(data.matrix(grades()[,1]) == input$NIU)], col=idcol , lwd=4)
})
FINAL <- data.matrix(grades()[,7])
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
FINAL <- data.matrix(grades[,7])
CONTINUOUS <- data.matrix(grades[,5])
library(readr)
grades <- read_csv("grades.csv")
View(grades)
FINAL <- data.matrix(grades[,7])
CONTINUOUS <- data.matrix(grades[,5])
prediction <- predict(linealModel, CONTINUOUS[which(data.matrix(grades[,1]) == input$NIU)])
library(readr)
grades <- read_csv("grades.csv")
View(grades)
FINAL <- data.matrix(grades[,7])
CONTINUOUS <- data.matrix(grades[,5])
FINAL
prediction <- predict(linealModel(), CONTINUOUS[which(data.matrix(grades[,1]) == 100394569)])
linealModel <- lm( FINAL ~ CONTINUOUS)
linealModel
library('shiny')
library('DT')
library('readr')
library('vioplot')
ui = fluidPage(
fileInput('file', 'Choose .CSV', accept = "text/csv",  placeholder = "No file selected"),
textInput("NIU", "NIU:", "100..."),
actionButton("go", "Go!"),
verbatimTextOutput('summaryLM'),
plotOutput('plotLM')
)
render = function(input, output) {
grades <- eventReactive(input$go, {
read_csv(input$file$datapath)
})
linealModel <- reactive({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
lm( FINAL ~ CONTINUOUS)
})
output$summaryLM <- renderPrint({
summary(linealModel())
})
output$plotLM <- renderPlot({
FINAL <- data.matrix(grades()[,7])
CONTINUOUS <- data.matrix(grades()[,5])
prediction <- predict(linealModel(), CONTINUOUS[which(data.matrix(grades()[,1]) == input$NIU)])
if(prediction[which(grades()[,1] == input$NIU)]<5){idcol <- 'red'}else{idcol <- 'green'}
plot(CONTINUOUS, FINAL, ylab = 'Final Grade', xlab = 'Continuous Assessment')
abline(linealModel())
abline(h = 5, lty = 2)
points(CONTINUOUS[which(data.matrix(grades()[,1])==input$NIU)], prediction[which(data.matrix(grades()[,1]) == input$NIU)], col=idcol , lwd=4)
})
}
shinyApp(ui = ui, render)
source('main.R')
source('main.R')
library(readr)
grades <- read_csv("grades.csv")
View(grades)
source('main.R')
FINAL <- data.matrix(grades[,7])
CONTINUOUS <- data.matrix(grades[,5])
source('main.R')
FINAL
CONTINUOUS[1]
CONTINUOUS[1,]
CONTINUOUS[,1]
source('main.R')
runApp()
runApp()
help("predict")
linealModel()
linealModel
library(readr)
grades <- read_csv("grades.csv")
View(grades)
FINAL <- data.matrix(grades[,7])
CONTINUOUS <- data.matrix(grades[,5])
prediction <- predict(linealModel(), CONTINUOUS[which(data.matrix(grades()[,1]) == input$NIU)])
CONTINUOUS[which(data.matrix(grades[,1]) == grades[1,1])]
CONTINUOUS[which(data.matrix(grades[,1]) == grades[1,1]),]
newData <- data.frame(CONTINUOUS = CONTINUOUS[which(data.matrix(grade[,1]) == grades[1,1])])
runApp()
library(shiny); source('main.R')
source('main.R')
