knitr::opts_chunk$set(
  warning = FALSE, 
  message = FALSE, 
  collapse = TRUE,
  comment = "#>"
)

Installing package from github

To install from github, you will need the devtools package. This can be installed with

install.packages(devtools)

Then we can use the command

devtools::install_github("jonotuke/painBiomarkR",build_vignettes = TRUE)

to install the painBiomarkR package.

Loading package

Once the package is installed, you can load it into R with

library(painBiomarkR)

Getting the data

The package painBiomarkR has the data from the literature review available to the user as a data-frame. This is loaed with the command:

data("biomarkers")

Each row of the data-frame is the information of a single biomarker mentioned within a paper.

For example, here are the first 6 rows:

head(biomarkers)

So we can see that the biomarker EM-2 is the sole biomarker mentioned in the paper with pubmed ID 25794206.

Information about each of the columns can be obtained from the help file associated with the data-frame. This is obtained by typing

?biomarkers

Susan, Mark: please check and give me the correct details.

Playing with the data

We advise using the tidyverse package to manipulate the data. Following are some examples.

Use filter to get specified rows.

For example if we want just those rows that have biomarker EM-2.

library(tidyverse)
biomarkers %>% filter(BIOMARKER == "EM-2")

Use select to get only specified rows

For example if we only want the columns STUDY (PMID) and BIOMARKER.

biomarkers %>% select(`STUDY (PMID)`, BIOMARKER)

Use group_by to get groups of rows

For example if we would like to calculate the proportion of increases for each biomarker

biomarkers %>% 
  group_by(BIOMARKER) %>% 
  summarise(prop = sum(RESPONSE == "Increase") / n())

Shiny app

There is a built-in shiny app that can be used to play with the data if you are not familiar with the tidyverse package.

This is started by typing

bioViewer()

This should open the viewer in a browser.

Other functions

We have added some extra functions.

First if you would like to open a given paper in pubmed, then you can use the open_pubmed() function. This will only allow you to open upto 10 pages at a time to avoid overloading your browser.

For a single paper.

PMID  <- biomarkers$`STUDY (PMID)`[1]
open_pubmed(PMID)

This will also open multiple papers.

PMID  <- unique(biomarkers$`STUDY (PMID)`)[1:2]
open_pubmed(PMID)


jonotuke/painBiomarkR documentation built on May 13, 2019, 3:01 a.m.