tests/testthat/test_professor_info_functions.R

context("figuring out what's happening with professor info functions")

test_that("calculating age is happening",{
  faculty = collect_faculty(2000, append_year=TRUE)
  # print(length(faculty))
  ages <- sapply(faculty, calculate_age)
  ages <- ages[ages > 0]
  # print(length(ages))
  # print(mean(ages))
  print(get_prof_year(faculty[1]))
  print(faculty[2])
#   year = 2013
#   faculty = collect_faculty(year)
#   n = 50
#   print(faculty[n])
#   print(paste0(":: is ", calculate_age(faculty[n])))
# #   ages = sapply(faculty, function(x)  calculate_age(x)[[1]])
# #   expect_that(min(ages)) #excellent place to consider using dataframes;
#   print(faculty[[70]])

  staff <- c()
  staff[[1]] <- collect_faculty(2001, append_year = TRUE)
  staff[[2]] <- collect_faculty(2002, append_year = TRUE)
  staff[[3]] <- collect_faculty(2003, append_year = TRUE)

  print(length(overlap(staff[[1]], staff[[2]])))
  print(length(overlap(staff[[2]], staff[[3]])))
})
PhilBrockman/WilliamsStaff documentation built on May 9, 2017, 6:36 p.m.