pubmed trend for pain
source('pubmed_trend.r') | |
sex.pub <- pubmed_trend(search.str = 'Sex+Characteristics[mh] AND Pain[mh]', year.span=1970:2011) | |
analgesic.pub <- pubmed_trend(search.str = 'Sex+Characteristics[mh] AND Analgesics[mh]', year.span=1970:2011) | |
source('plot_bar.r') | |
library("RColorBrewer") | |
pdf(file='sex_pain.pdf', height=8, width=8) | |
par(las=1) | |
colorfunction = colorRampPalette(brewer.pal(9, "Reds")) | |
mycolors = colorfunction(length(sex.pub)) | |
plot_bar(x=sex.pub, linecol="#525252", cols=mycolors, addArg=FALSE) | |
colorfunction = colorRampPalette(brewer.pal(9, "Blues")) | |
mycolors = colorfunction(length(analgesic.pub)) | |
plot_bar(x=analgesic.pub, linecol='black', cols=mycolors, addArg=TRUE) | |
title('Number of publication per year') | |
legend('topleft', | |
legend=c('Sex and Pain', 'Sex and Analgesics'), | |
fill=c("red", "blue"), | |
bty="n", | |
cex=1.1 | |
) | |
dev.off() |
This comment has been minimized.
This comment has been minimized.
Thanks produnis, |
This comment has been minimized.
This comment has been minimized.
thx dude, great work btw!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
To make this work on Ubuntu, you need to prepare your system like this:
In Ubuntu, install XML and Curl support.
Otherwise, installation of R-Packages will fail
Open a terminal and type in:
sudo apt-get install libxml2-dev curl libcurl4-openssl-dev
the perl script needs the TGEN-EUtils
download package TGen-EUtils-0.xxx.tar.gz from http://bioinformatics.tgen.org/brunit/downloads/tgen-eutils/
extract it to some place you like, e.g. ~/Downloads/
in terminal go to the extracted folder
type in:
perl Makefile.PL
make
make test
sudo make install
Start R
install packages 'XML', 'RCurl', 'RColorBrewer'
type in:
install.packages(c('XML', 'RCurl', 'RColorBrewer'),dependencies=T)
Now the Script should work
Works at least under Ubuntu 12.04 LTS precise 64
Have fun