Skip to content

dslabscl/PM566

 
 

Repository files navigation

Course Material for PM566

The PM566 course website is here. We will be using this website to share all course material including lecture slides, labs, and assignments.

Our class meets at 1pm every Wednesday. Zoom links for each lecture session are available in the course Blackboard.

Latest week’s cross reference

This is an example of web scrapping. We built this program to extract the cross-reference links from a given GitHub issue, including details such as timestamp, the user, and the commit message.

You can download the program here

library(data.table)
library(stringr)

# API access
source("list_cross_ref_api.R", echo=FALSE)
library(httr)
# Setting up the token
if (file.exists("github_app.R")) {
  # See
  # https://github.com/r-lib/httr/blob/cb4e20c9e0b38c0c020a8756db8db7a882288eaf/demo/oauth2-github.r
  # For a detailed example
  source("github_app.R")
  token <- oauth2.0_token(
    endpoint = oauth_endpoints("github"),
    app      = github_app,
    config   = httr::config(connecttimeout = 60)
    )
  token <- httr::config(token = token)
} else {
  token <- NULL
}

# Retrieving all the cross-reference information
ans <- list_cross_ref_api(
  issue = 26,
  config = c(httr::config(connecttimeout=60), token)
  )
# Preparing to print using a nice format
ans[, user := sprintf("[%s](https://github.com/%s)", gsub("/.+", "", repo), repo)]
ans[, link := sprintf("[link](%s)", commit_url)]
setorder(ans, created_at)

# A more concise message
ans[, message := sprintf("%s (%s to this %s) (files: %s)", message, link, type, files)]
knitr::kable(ans[, .(created_at, user, message, type)])
created_at user message type
2020-09-25T20:19:10Z NA (link to this NA) (files: ) NA
2020-09-25T20:19:19Z NA (link to this NA) (files: ) NA
2020-09-25T20:19:36Z NA (link to this NA) (files: ) NA
2020-09-30T22:42:46Z hankezhe add Lab 07 step 1 USCbiostats#26 (link to this lab) (files: 07-lab.Rmd, 07-lab.md) lab
2020-10-01T00:10:16Z hankezhe Lab 07 was done USCbiostats#26 (link to this lab) (files: 07-lab.Rmd, 07-lab.md) lab
2020-10-01T00:10:35Z gvegayon Lab 7 done USCbiostats#26 (link to this lab) (files: week7/README.Rmd, week7/README.md) lab
2020-10-01T00:10:43Z eshkim1021 Finish Lab 7USCbiostats#26 (link to this lab) (files: Lab 7.Rmd, Lab-7.md) lab
2020-10-01T00:11:17Z bcruiz Lab7 USCbiostats#26 (link to this lab) (files: Lab7.Rmd, Lab7.md) lab
2020-10-01T00:12:12Z slee2424 lab7 done USCbiostats#26 (link to this lab) (files: lab7.Rmd, lab7.md) lab
2020-10-01T00:15:14Z HopeW233 adding lab 7 USCbiostats#26 (link to this lab) (files: week7/README.Rmd, week7/README.md) lab
2020-10-01T00:15:17Z jiaheche Lab7 USCbiostats#26 (link to this lab) (files: 07-lab.Rmd, 07-lab.md) lab
2020-10-01T00:20:50Z mbolshakova Lab 7 USCbiostats#26 (link to this lab) (files: Lab-7.md, Lab-7_cache/html/__packages, Lab-7_cache/html/counter-pubmed_af9409d9095e9232821cb2dc029d80d0.RData, Lab-7_cache/html/counter-pubmed_af9409d9095e9232821cb2dc029d80d0.rdb, Lab-7_cache/html/counter-pubmed_af9409d9095e9232821cb2dc029d80d0.rdx, Lab-7_cache/markdown_github/__packages, Lab-7_cache/markdown_github/counter-pubmed_6670a29088ce78b20f5cab969c0ac0b5.RData, Lab-7_cache/markdown_github/counter-pubmed_6670a29088ce78b20f5cab969c0ac0b5.rdb, Lab-7_cache/markdown_github/counter-pubmed_6670a29088ce78b20f5cab969c0ac0b5.rdx) lab
2020-10-01T00:23:10Z asuasu95 finish lab7 USCbiostats#26 (link to this lab) (files: 07-lab/07-lab.Rmd, 07-lab/07-lab.md) lab
2020-10-01T00:25:53Z MingzhiYe16 lab7 USCbiostats#26 (link to this lab) (files: README.Rmd, README.md) lab
2020-10-01T00:27:21Z Luqing521 lab07 USCbiostats#26 (link to this lab) (files: lab07/07-lab.Rmd, lab07/07-lab.md) lab
2020-10-01T00:31:17Z Shan-shan-666 Done lab 7USCbiostats#26 (link to this lab) (files: lab/07-lab.Rmd) lab
2020-10-01T00:35:57Z RuowenWang123 lab 07 (link to this lab) (files: lab07.Rmd, lab07.md) lab
2020-10-01T00:35:59Z ashwathkraj USCbiostats#26 (link to this NA) (files: .Rproj.user/DCB78155/sources/prop/80414198, .Rproj.user/DCB78155/sources/s-C976EDB0/31DB5E9C, .Rproj.user/DCB78155/sources/s-C976EDB0/31DB5E9C-contents, .Rproj.user/shared/notebooks/833EAC6E-README/1/DCB78155C976EDB0/chunks.json, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/ccku1u4s4ntwu/000002.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/ccku1u4s4ntwu/000003.error, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/ceg5hyjejvm7s/00000c.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/chunks.json, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/cms8o2kwfzep2/000002.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/cot3qp8d6t7gn/000002.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/criafkwas143o/000006.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/csetup_chunk/000002.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/cva79p0j0386v/000002.csv, pm566-07-lab/README.Rmd, pm566-07-lab/README.html) NA
2020-10-01T00:39:05Z ashwathkraj USCbiostats#26 lab 7 complete (link to this lab) (files: .Rproj.user/DCB78155/sources/prop/80414198, .Rproj.user/DCB78155/sources/s-C976EDB0/31DB5E9C, .Rproj.user/DCB78155/sources/s-C976EDB0/31DB5E9C-contents, .Rproj.user/shared/notebooks/833EAC6E-README/1/DCB78155C976EDB0/chunks.json, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/ccku1u4s4ntwu/000002.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/ccku1u4s4ntwu/000003.error, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/ceg5hyjejvm7s/00000c.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/chunks.json, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/cms8o2kwfzep2/000002.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/cot3qp8d6t7gn/000002.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/criafkwas143o/000006.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/csetup_chunk/000002.csv, .Rproj.user/shared/notebooks/833EAC6E-README/1/s/cva79p0j0386v/000002.csv, pm566-07-lab/README.Rmd, pm566-07-lab/README.html) lab
2020-10-01T00:41:50Z Weijia-H Add files via upload (link to this NA) (files: 07-lab.Rmd, 07-lab.md) NA
2020-10-01T01:59:39Z cbegay89 Lab 7 Complete (link to this lab) (files: Week 7/READMELab7.md, Week 7/READMELab7.rmd) lab
2020-10-01T03:10:18Z shawnyeusc lab07 USCbiostats#26 (link to this lab) (files: Lab07.Rmd) lab
2020-10-01T03:54:36Z yina-liu lab07 USCbiostats#26 (link to this lab) (files: Lab07-Yina.Rmd, Lab07-Yina.md) lab
2020-10-01T04:07:30Z jiqingwu1997 lab 7 USCbiostats#26 (link to this lab) (files: lab7.Rmd, lab7.html) lab
2020-10-01T07:17:24Z ameihao Finalizing lab 7 USCbiostats#26 (link to this lab) (files: .DS_Store, lab07.Rmd, lab07.html) lab
2020-10-01T09:36:26Z shiyushen lab07 done USCbiostats#26 (link to this lab) (files: 07-lab/07-lab.Rmd, 07-lab/07-lab.md) lab
2020-10-03T04:41:53Z stephtring Lab 7 “USCbiostats#26” (link to this lab) (files: Lab7/README.md) lab

Releases

No releases published

Packages

No packages published

Languages

  • HTML 93.1%
  • JavaScript 6.1%
  • CSS 0.5%
  • Jupyter Notebook 0.2%
  • R 0.1%
  • Sass 0.0%