Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
## Helper Script for SafeCampus ##
# Building selector sub-lists
academic <- list(
"Amos Eaton"="amos",
"Carnegie Building"="carn",
"CBIS"="biot",
"CII"="cii",
"Cogswell Lab"="cogs",
"DCC"="dcc",
"Folsom Library"="lib",
"Greene Building"="gree",
"JEC"="jec",
"Lally Building"="lall",
"Materials Research Center"="mrc",
"Pittsburgh Building"="pitt",
"Polymer Center"="poly",
"Rensselaer Union"="unio",
"Ricketts Building"="rick",
"Sage Lab"="sage",
"Science Center"="scic",
"Troy Building"="troy",
"Voorhees Computing Center"="vcc",
"Walker Lab"="walk",
"West Hall"="west",
"Winslow Building"="wins")
greek <- list(
"Alpha Epsilon Pi, 284 Pawling Ave"="aepi",
"Delta Phi, 311 Congress St"="cong",
"Delta Tau Delta, 133 Sunset Terrace"="delt",
"Lambda Chi Alpha, 200 Sunset Terrace" ="lxa",
"Phi Kappa Theta, 107 Sunset Terrace" ="phik",
"Phi Mu Delta, 224 Pawling Ave"="phim",
"Phi Sigma Kappa, 316/320 Congress St"="phis",
"Theta Chi, 2100 Burdett Ave"="thetc",
"Theta Xi, 1490 Sage Ave"="thetx",
"Zeta Psi, 25 Belle Ave"="zeta")
housing <- list(
"Albright Court #71"="albr71",
"Albright Court #73"="albr73",
"Albright Court #76"="albr76",
"Albright Court #82"="albr82",
"Albright Court #84"="albr84",
"Albright Court #85"="albr85",
"Albright Court #88"="albr88",
"Albright Court #91"="albr91",
"Albright Court #94"="albr94",
"Albright Court #95"="albr95",
"Albright Court #97"="albr97",
"BARH A"="barha",
"BARH B" = "barhb",
"BARH C" = "barhc",
"BARH D" = "barhd",
"Barton Hall"="bart",
"Beman Lane #11"="bema11",
"Beman Lane #13"="bema13",
"Beman Lane #15"="bema15",
"Beman Lane #16"="bema16",
"Beman Lane #18"="bema18",
"Beman Lane #21"="bema21",
"Beman Lane #23"="bema23",
"Beman Lane #25"="bema25",
"Beman Lane #26"="bema26",
"Beman Lane #28"="bema28",
"Blitman Commons"="blit",
"Bray Hall"="bray",
"Brinsmade Terrace #11"="brin11",
"Brinsmade Terrace #13"="brin13",
"Brinsmade Terrace #16"="brin16",
"Brinsmade Terrace #21"="brin21",
"Brinsmade Terrace #23"="brin23",
"Brinsmade Terrace #26"="brin26",
"Brinsmade Terrace #32"="brin32",
"Brinsmade Terrace #34"="brin34",
"Brinsmade Terrace #35"="brin35",
"Brinsmade Terrace #41"="brin41",
"Brinsmade Terrace #43"="brin43",
"Brinsmade Terrace #46"="brin46",
"Bryckwyck Apts, Sunset Terrace"="bryc",
"Burdett Ave #2144" ="burd",
"Cary Hall"="cary",
"Chasen Building, downtown"="chas",
"City Station South"="ctys",
"City Station West"="ctyw",
"Colonie Apts Bldg A"="coloa",
"Colonie Apts Bldg B"="colob",
"Colonie Apts Bldg C"="coloc",
"Colonie Apts Bldg D"="colod",
"Colvin Circle #12"="colv12",
"Colvin Circle #14"="colv14",
"Colvin Circle #16"="colv16",
"Colvin Circle #22"="colv22",
"Colvin Circle #24"="colv24",
"Colvin Circle #26"="colv26",
"Colvin Circle #28"="colv28",
"Colvin Circle #30"="colv30",
"Colvin Circle #31"="colv31",
"Colvin Circle #34"="colv34",
"Colvin Circle #36"="colv36",
"Colvin Circle #42"="colv42",
"Colvin Circle #43"="colv43",
"Colvin Circle #44"="colv44",
"Colvin Circle #52"="colv52",
"Colvin Circle #54"="colv54",
"Colvin Circle #56"="colv56",
"Colvin Circle #62"="colv62",
"Colvin Circle #64"="colv64",
"Colvin Circle #66"="colv66",
"Crockett Hall"="croc",
"Davison Hall"="davi",
"E-Housings (Cass)"="cass",
"E-Housings (Clem)"="clem",
"E-Housings (Hear)"="hear",
"E-Housings (Hira)"="hira",
"E-Housings (Voor)"="voor",
"E-Housings (Wait)"="wait",
"Gurley Building, downtown"="gurl",
"Hall Hall"="hall",
"McGiffert, Stacwyck Apartments" ="mcgi",
"Nason Hall"="naso",
"North Hall"="nort",
"Nugent Hall"="nuge",
"Polytech Apartments"="polyt",
"Quad (Cald)"="cald",
"Quad (Buck)"="buck",
"Quad (Chur)"="chur",
"Quad (Coop)"="coop",
"Quad (Hunt)"="hunt",
"Quad (IPAC)"="ipac",
"Quad (Macd)"="macd",
"Quad (Pard)"="pard",
"Quad (Roeb)"="roeb",
"Quad (Whit)"="whit",
"Rousseau, Stacwyck Apartments"="rous",
"Sharp Hall"="shar",
"Tech Terrace Apartments"="tech",
"Thompson, Stacwyck Apartments"="thom",
"Williams, Stacwyck Apartments"="will",
"Wiltsie, Stacwyck Apartments"="wilt",
"Warren Hall"="warr")
otherOffCampus <- list(
"90 College Ave"="coll",
"CCI, North Greenbush"="cci",
"College Ave #92, RPI Ambulance"="ambu",
"DFWI, Lake George"="dfwi",
"Jordan Road #405, Tech Park, CCI"="cci",
"Jordan Road #250, Tech Park"="techp250",
"Jordan Road #350, Tech Park"="techp350",
"Jordan Road #465, Tech Park"="techp465",
"LINAC/NES, Tibbits Ave"="linac",
"Moes, College Ave"="moes",
"Off Campus Commons, 1525 15th St"="offc",
"Old Bumstead Garage, behind Colonie Apts"="bums",
"Pahl House, corner of 15th and Peoples"="pahl",
"Peoples Ave #1002"="peop1002",
"Peoples Ave #1516"="peop1516",
"Peoples Ave #901"="peop901",
"Peoples Ave #907"="peop907",
"President's House"="pres",
"Proctors Building, downtown"="proc",
"Rensselaer at Hartford"="cap0",
"SAE, 12 Myrtle Ave off Pawling Ave"="sael",
"Service Building, Peoples Ave"="servb",
"Walthousen Lab, Schenectady"="sche",
"Watervliet Facility, 805 25th St, Watervliet"="wate")
otherOnCampus <- list(
"87 Gym"="gym8",
"Academy Hall"="acad",
"Admissions"="admi",
"ASRC"="armo",
"ASRC auto shop"="auto",
"ASRC garage"="garg",
"College Ave #90, EMPAC resident artists" = "empar",
"Commons Dining Hall"="comm",
"East Campus Community Center"="eccc",
"ECAV arena"="ecav",
"ECAV stadium"="ecavs",
"EMPAC"="empa",
"Fitness Center"="fitn",
"H Building"="hbui",
"Heffner Alumni House"="heff",
"Houston Field House"="fiel",
"J Building, Peoples Ave"="jbui",
"RPI Playhouse, 15th St"="play",
"Robison Pool"="robi",
"Russell Sage Dining Hall"="rsdh",
"Visitor Information Center, Public Safety"="vic0",
"WRPI tower, North Greenbush" ="wrpi")
alltype<-list("academic"=academic,"greek"=greek,"housing"=housing,"otherOffCampus"=otherOffCampus,"otherOnCampus"=otherOnCampus)
#custom color palette
palette <- c("darkred", "red4", "red3", "indianred3", "salmon", "lightskyblue", "steelblue1", "royalblue1", "royalblue4", "navyblue", "midnightblue")
#finding most recent time and date in data
now_data <- rpi_wap_raw %>% filter(Date==max(rpi_wap_raw$Date))
now_time <- as_datetime(hms::parse_hm(toString(now_data$time[nrow(now_data)])))
#semester dates
fall_dates <- seq(as.Date('2020-08-31'), as.Date('2020-11-20'), by = 'days')
spring_dates <- seq(as.Date('2021-01-25'), as.Date('2021-05-23'), by = 'days')
summer_dates <- seq(as.Date('2021-05-24'), as.Date('2021-08-20'), by = 'days')
#functions to help determine if we are going backwards or forwards in time for switching semesters
semester_val <- function(semester){
if(semester == "f20"){
value <- 1
}
else if(semester == "s21"){
value <- 2
}
else if(semester == "su21"){
value <- 3
}
value
}
date_val <- function(date){
if(date %in% fall_dates){
value <- 1
}
else if(date %in% spring_dates){
value <- 2
}
else if(date %in% summer_dates){
value <- 3
}
value
}