Week 2A SQL and R: Requirements

Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.

Running Code

When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

library(readxl)
 Performed <- read_excel("~/Performed.xlsx")
View(Performed)                                                                                                   
summary(Performed)
   student_id           gender     study_time_hours attendance_percent
 Min.   :   1.0   Length   :1000   Min.   :0.500    Min.   : 54.80    
 1st Qu.: 250.8   N.unique :   2   1st Qu.:2.600    1st Qu.: 78.80    
 Median : 500.5   N.blank  :   0   Median :3.600    Median : 85.20    
 Mean   : 500.5   Min.nchar:   4   Mean   :3.571    Mean   : 85.09    
 3rd Qu.: 750.2   Max.nchar:   6   3rd Qu.:4.500    3rd Qu.: 91.90    
 Max.   :1000.0                    Max.   :8.100    Max.   :100.00    
  sleep_hours   parental_education  internet_access extracurricular_activities
 Min.   : 3.2   Length   :1000     Length   :1000   Length   :1000            
 1st Qu.: 5.9   N.unique :   5     N.unique :   2   N.unique :   2            
 Median : 6.8   N.blank  :   0     N.blank  :   0   N.blank  :   0            
 Mean   : 6.8   Min.nchar:   3     Min.nchar:   2   Min.nchar:   2            
 3rd Qu.: 7.6   Max.nchar:  11     Max.nchar:   3   Max.nchar:   3            
 Max.   :10.0                                                                 
   part_time_job  previous_grade   final_exam_score    final_grade  
 Length   :1000   Min.   : 31.30   Min.   : 46.80   Length   :1000  
 N.unique :   2   1st Qu.: 61.00   1st Qu.: 76.08   N.unique :   5  
 N.blank  :   0   Median : 69.60   Median : 83.80   N.blank  :   0  
 Min.nchar:   2   Mean   : 69.74   Mean   : 83.54   Min.nchar:   1  
 Max.nchar:   3   3rd Qu.: 78.40   3rd Qu.: 91.53   Max.nchar:   1  
                  Max.   :100.00   Max.   :100.00                   
library(readxl)
plot(
  Performed$study_time_hours,
  Performed$final_exam_score,
  main = "Study Time vs Final Exam Score",
  xlab = "Study Time (Hours)",
  ylab = "Final Exam Score",
  pch = 19
)

plot(
  Performed$attendance_percent,
  Performed$final_exam_score,
  main = "Attendance vs Final Exam Score",
  xlab = "Attendance (%)",
  ylab = "Final Exam Score",
  pch = 19
)

You can add options to executable code like this

The echo: false option disables the printing of code (only output is displayed).