Clear all objects

rm(list=ls())

packages

require(RCurl)
## Loading required package: RCurl
## Warning in library(package, lib.loc = lib.loc, character.only = TRUE,
## logical.return = TRUE, : there is no package called 'RCurl'
require(bitops)
## Loading required package: bitops
# load scripts and functions  
#getting project numbers and names
#source("ProjectNames.R") #function is project.names()

projects = function(...)
  {
  project.num = c(rev(ProjectID[1:7,2]), ProjectID[8:11,2])
  project.num <<- project.num
  biol.names = rev(paste0(ProjectID[1:7,3], "Sem", ProjectID[1:7,5], ProjectID[1:7,6]))
  biom.names = paste0(ProjectID[8:11,3], "Sem", ProjectID[8:11,5], ProjectID[8:11,6])
  project.names = c(biol.names, biom.names)
  project.names <<- project.names
  }

source("Functions to load UQM data.R")


#function for names inside a list
names.ls = function(ls)
  {
  n = NULL
  n = as.list(n)
  for (i in 1:length(ls))
    n[[i]] = names(ls[[i]])
  print(n)
  }



#removing rows with missing data
remover = function(df, col)
  {
  df2 = df
  remove = rev(which(is.na(df[,col])))
  if (length(remove) > 0)
    {
    df2 = df[-remove,]
    }
  return(df2)
  }

#using lookup tables
#source("/Users/kirsten/R Studio files/addNewData.R")

load data

projects of interest

ProjectID = read.csv("ProjectIDs.csv")
ProjectID
##     X ProjectID   Course Year Semester  AssName LxRx LxSxRx
## 1   1        45 BIOL1040 2013        2 Report 3 L1R3 L1S2R3
## 2   2        44 BIOL1040 2013        2 Report 2 L1R2 L1S2R2
## 3   3        43 BIOL1040 2013        2 Report 1 L1R1 L1S2R1
## 4   4        40 BIOL1040 2013        1 Report 4 L1R4 L1S1R4
## 5   5        39 BIOL1040 2013        1 Report 3 L1R3 L1S1R3
## 6   6        32 BIOL1040 2013        1 Report 2 L1R2 L1S1R2
## 7   7        31 BIOL1040 2013        1 Report 1 L1R1 L1S1R1
## 8   8        34 BIOM2011 2013        1 Report 1 L2R1 L2S1R1
## 9   9        41 BIOM2011 2013        1 Report 2 L2R2 L2S1R2
## 10 10        48 BIOM2011 2013        2 Report 1 L2R1 L2S2R1
## 11 11        50 BIOM2011 2013        2 Report 2 L2R2 L2S2R2
## 12 12        28 BIOM2013 2013        1     Oral L2R1 L2S1R1
## 13 13        42 BIOM2013 2013        1   Report L2R2 L2S1R2
## 14 14        63 BIOM2013 2014        1     Oral L2R1 L2S1R1
projects()
project.num
##  [1] 31 32 39 40 43 44 45 34 41 48 50
project.names
##  [1] "BIOL1040Sem1Report 1" "BIOL1040Sem1Report 2" "BIOL1040Sem1Report 3"
##  [4] "BIOL1040Sem1Report 4" "BIOL1040Sem2Report 1" "BIOL1040Sem2Report 2"
##  [7] "BIOL1040Sem2Report 3" "BIOM2011Sem1Report 1" "BIOM2011Sem1Report 2"
## [10] "BIOM2011Sem2Report 1" "BIOM2011Sem2Report 2"
AcP = Ac.performance(project.num, project.names) #creates a list called AcP for the 11 reports
FbP = Fb.provision(project.num, project.names) #creates a list called FbP for the 11 reports
FbU = Fb.use(project.num, project.names) #creates a list called FbU for the 11 reports

names.ls(AcP)
## [[1]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Hypoth"              "Methods.writing"    
##  [7] "Methods.details"     "Methods.design"      "Results.text"       
## [10] "Results.figures"     "Results.legends"     "Disc.knowlede"      
## [13] "Disc.InterpFindings" "Disc.Evidence"       "Refs"               
## [16] "Writing"             "Comments"            "Final.Grade"        
## [19] "UQM.ID"              "Consent"            
## 
## [[2]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Hypoth"              "Methods.writing"    
##  [7] "Methods.details"     "Methods.design"      "Results.text"       
## [10] "Results.figures"     "Results.legends"     "Disc.knowlede"      
## [13] "Disc.InterpFindings" "Disc.Evidence"       "Refs"               
## [16] "Writing"             "Comments"            "Final.Grade"        
## [19] "UQM.ID"              "Consent"            
## 
## [[3]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Hypoth"              "Methods.writing"    
##  [7] "Methods.details"     "Methods.design"      "Results.text"       
## [10] "Results.figures"     "Results.legends"     "Disc.knowlede"      
## [13] "Disc.InterpFindings" "Disc.Evidence"       "Refs"               
## [16] "Writing"             "Comments"            "Final.Grade"        
## [19] "UQM.ID"              "Consent"            
## 
## [[4]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Hypoth"              "Methods.writing"    
##  [7] "Methods.details"     "Methods.design"      "Results.text"       
## [10] "Results.figures"     "Results.legends"     "Disc.knowlede"      
## [13] "Disc.InterpFindings" "Disc.Evidence"       "Refs"               
## [16] "Writing"             "Comments"            "Final.Grade"        
## [19] "UQM.ID"              "Consent"            
## 
## [[5]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Hypoth"              "Methods.writing"    
##  [7] "Methods.details"     "Methods.design"      "Results.text"       
## [10] "Results.figures"     "Results.legends"     "Disc.knowlede"      
## [13] "Disc.InterpFindings" "Disc.Evidence"       "Refs"               
## [16] "Writing"             "Comments"            "Final.Grade"        
## [19] "UQM.ID"              "Consent"            
## 
## [[6]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Hypoth"              "Methods.writing"    
##  [7] "Methods.details"     "Methods.design"      "Results.text"       
## [10] "Results.figures"     "Results.legends"     "Disc.knowlede"      
## [13] "Disc.InterpFindings" "Disc.Evidence"       "Refs"               
## [16] "Writing"             "Comments"            "Final.Grade"        
## [19] "UQM.ID"              "Consent"            
## 
## [[7]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Hypoth"              "Methods.writing"    
##  [7] "Methods.details"     "Methods.design"      "Results.text"       
## [10] "Results.figures"     "Results.legends"     "Disc.knowlede"      
## [13] "Disc.InterpFindings" "Disc.Evidence"       "Refs"               
## [16] "Writing"             "Comments"            "Final.Grade"        
## [19] "UQM.ID"              "Consent"            
## 
## [[8]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Intro"               "Hypoth"             
##  [7] "Methods"             "Results.text"        "Fig.Tables"         
## [10] "Legend.Title"        "Disc.InterpFindings" "Disc.IntegrateLit"  
## [13] "Refs"                "Kn.PhysMechs"        "Kn.ExpApproach"     
## [16] "W.Structure"         "W.LanguageJargon"    "W.GrammarSpelling"  
## [19] "Final.Grade"        
## 
## [[9]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Intro"               "Hypoth"             
##  [7] "Methods"             "Results.text"        "Fig.Tables"         
## [10] "Legend.Title"        "Disc.InterpFindings" "Disc.IntegrateLit"  
## [13] "Refs"                "Kn.PhysMechs"        "Kn.ExpApproach"     
## [16] "W.Structure"         "W.LanguageJargon"    "W.GrammarSpelling"  
## [19] "Final.Grade"        
## 
## [[10]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Intro"               "Hypoth"             
##  [7] "Methods"             "Results.text"        "Fig.Tables"         
## [10] "Legend.Title"        "Disc.InterpFindings" "Disc.IntegrateLit"  
## [13] "Refs"                "Kn.PhysMechs"        "Kn.ExpApproach"     
## [16] "W.Structure"         "W.LanguageJargon"    "W.GrammarSpelling"  
## [19] "Final.Grade"        
## 
## [[11]]
##  [1] "StudentID"           "SubmissionID"        "MarkerID"           
##  [4] "Publish.Time"        "Intro"               "Hypoth"             
##  [7] "Methods"             "Results.text"        "Fig.Tables"         
## [10] "Legend.Title"        "Disc.InterpFindings" "Disc.IntegrateLit"  
## [13] "Refs"                "Kn.PhysMechs"        "Kn.ExpApproach"     
## [16] "W.Structure"         "W.LanguageJargon"    "W.GrammarSpelling"  
## [19] "Final.Grade"
names.ls(FbP)
## [[1]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"     
## 
## [[2]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"     
## 
## [[3]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"     
## 
## [[4]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"     
## 
## [[5]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"     
## 
## [[6]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"     
## 
## [[7]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"     
## 
## [[8]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"     
## 
## [[9]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"     
## 
## [[10]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"     
## 
## [[11]]
##  [1] "SubID"        "MarkerID"     "AnnotType"    "Page"        
##  [5] "Xlocation"    "Ylocation"    "Xdim"         "Ydim"        
##  [9] "Filename"     "Annotation"   "Duration.sec" "Consent"
names.ls(FbU)
## [[1]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"      
## 
## [[2]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"      
## 
## [[3]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"      
## 
## [[4]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"      
## 
## [[5]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"      
## 
## [[6]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"      
## 
## [[7]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"      
## 
## [[8]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"      
## 
## [[9]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"      
## 
## [[10]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"      
## 
## [[11]]
##  [1] "EventID"        "SubmissionID"   "StudentID"      "Consent"       
##  [5] "MarkerID"       "Audio.Annot"    "Log.Type"       "Interaction"   
##  [9] "Date"           "State"          "Pages"          "Start"         
## [13] "End"            "Page.Size"      "msec.B4.scroll" "AnnotID"       
## [17] "From.time"      "Current.time"   "Duration"       "Filename"

adding word count variable

ls = FbP

for (l in 1:length(ls))
  ls[[l]][,13] = 0

for (l in 1:length(ls))
  for (i in 1:nrow(ls[[l]]))
    if (ls[[l]][i,3] == "Text")
      ls[[l]][i,13] = sapply(gregexpr("\\W+", ls[[l]][i,10]), length)

n = names(ls[[1]])
n[13] = "WordCount"
for (l in 1:length(ls))
  names(ls[[l]]) = n

ls.words = NULL
for (l in 1:length(ls))
  ls.words[[l]] = tapply(ls[[l]][,13], ls[[l]][,1], sum)

mean(ls.words[[1]])
## [1] 122.9639
summary(ls.words[[1]])
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##       0       4     106     123     222     423
sapply(ls.words, mean)
##  [1] 122.96387  62.85693  60.25333  43.21810  87.85369  95.56109  65.58440
##  [8]  44.65789  33.65368  60.20000  24.28378
sapply(ls.words, sd)
##  [1] 113.29030  76.59486  88.20002  58.42333 100.38549  94.73664  63.95592
##  [8] 112.58429  89.33981 132.74878  78.70885
sample.size = function(ls)
  {
  n = NULL
  n = as.list(n)
  for (i in 1:length(ls))
    n[[i]] = nrow(ls[[i]])
  print(n)
  }

sample.size(ls.words)
## [[1]]
## [1] 692
## 
## [[2]]
## [1] 678
## 
## [[3]]
## [1] 675
## 
## [[4]]
## [1] 674
## 
## [[5]]
## [1] 909
## 
## [[6]]
## [1] 884
## 
## [[7]]
## [1] 859
## 
## [[8]]
## [1] 228
## 
## [[9]]
## [1] 231
## 
## [[10]]
## [1] 80
## 
## [[11]]
## [1] 74
#b = NULL
#for (l in 1:length(ls.words))
#  b[[l]] = boxplot()


boxplot(ls.words, main = "Word count for text feedback across 11 reports", xlab = "Reports", ylab = "words per report")

audio

ls.audio = NULL
for (l in 1:length(ls))
  ls.audio[[l]] = tapply(ls[[l]][,11], ls[[l]][,1], sum)

#mean(lls.audio[[1]])
summary(ls.audio[[1]])
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##     3.0   212.5   256.0   310.7   348.5  1120.0     541
sapply(ls.audio, mean)
##  [1] NA NA NA NA NA NA NA NA NA NA NA
sapply(ls.audio, sd)
##  [1] NA NA NA NA NA NA NA NA NA NA NA
sample.size = function(ls)
  {
  n = NULL
  n = as.list(n)
  for (i in 1:length(ls))
    n[[i]] = nrow(ls[[i]])
  print(n)
  }

sample.size(ls.audio)
## [[1]]
## [1] 692
## 
## [[2]]
## [1] 678
## 
## [[3]]
## [1] 675
## 
## [[4]]
## [1] 674
## 
## [[5]]
## [1] 909
## 
## [[6]]
## [1] 884
## 
## [[7]]
## [1] 859
## 
## [[8]]
## [1] 228
## 
## [[9]]
## [1] 231
## 
## [[10]]
## [1] 80
## 
## [[11]]
## [1] 74
#b = NULL
#for (l in 1:length(ls.audio))
#  b[[l]] = boxplot()


boxplot(ls.audio, main = "Duration of audio feedback across 11 reports", xlab = "Reports", ylab = "seconds per report")

written and audio feedback by academic performance band

#ls.audio

#AcP.FbP = NULL
#for (l in 1:7)
#  AcP.FbP[[l]] = merge(AcP[[l]][,c(1:3,18)], FbP)

#ls.audio.grade = NULL
#for (l in 1:length(ls))
#  ls.audio.grade[[l]] = tapply(ls[[l]][,11], ls[[l]][,18], mean)