knitr::opts_chunk$set( warning = FALSE, message = FALSE, collapse = TRUE, comment = "#>" )
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.
Once the package is installed, you can load it into R with
library(painBiomarkR)
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.
We advise using the tidyverse
package to manipulate the data. Following are some examples.
For example if we want just those rows that have biomarker EM-2
.
library(tidyverse) biomarkers %>% filter(BIOMARKER == "EM-2")
For example if we only want the columns STUDY (PMID)
and BIOMARKER
.
biomarkers %>% select(`STUDY (PMID)`, BIOMARKER)
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())
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.