This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%%%%%%%%%%%%%%%%%%%%%%% | |
%% EPS TO PDF CONVERTER %% | |
%%%%%%%%%%%%%%%%%%%%%%%% | |
% Author: Mareviv | |
% Under GNU General Public License | |
% Paste this document entirely into a file with .TEX extension (.tex). Open it with TeXworks | |
% Tips for starting with LaTeX: http://talesofr.wordpress.com/2013/05/02/learning-latex-from-scratch/ | |
\documentclass{article} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################### | |
### Network graphs using package igraph ### | |
########################################### | |
# Author: Aurora-Mareviv | |
# Under GNU General Public License | |
# Script not intended for running using source() | |
# Simple script that draws a network | |
library(igraph) | |
load("my_directory/my_file.rda") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################################################### | |
### Network graphs from adjacency matrix - II part ## | |
##################################################### | |
# Author: Aurora-Mareviv | |
# Under GNU General Public License | |
# If we must construct an adjacency matrix: | |
# May be the cleanest way to plot links using igraph | |
# This Gist uses almost the same code as: https://gist.github.com/aurora-mareviv/5568957#file-gistfile1-r | |
# Paste and execute this simple code in a R console: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#under GNU General Public License | |
#server.R | |
library(shiny) | |
library(ggplot2) | |
shinyServer(function(input, output) { | |
## My function: | |
f <- function(min.cases, max.cases, p0, OR.cas.ctrl, Nh, sig.level) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#under GNU General Public License | |
#server.R | |
library(shiny) | |
library(ggplot2) | |
shinyServer(function(input, output) { | |
## My function: | |
f <- function(n.cases, p0, OR.cas.ctrl, Nh, sig.level) { | |
ncases <- n.cases | |
p0 <- p0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################## | |
### COMMANDS TO START WITH R CONSOLE 1 ### | |
########################################## | |
# Under GNU-GPL license v.3 | |
# First, install R: http://cran.r-project.org/ | |
# Second, install and open R-Studio: http://www.rstudio.com/ide/download/desktop | |
# You can open this text file from inside R-studio, or with a basic text editor (like Notepad). | |
# Just copy and paste the following commands, and press ENTER to see the results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################### | |
### COMMANDS TO START WITH R ON ANDROID ### | |
########################################### | |
# Under GNU-GPL license | |
# R in Android installed via the apps "GNURoot" and "GNURoot Wheezy", and sources.list updated with the newest CRAN repositories. | |
# I strongly recommend to set the working directory of R to a folder that can be accessed from Android such as /sdcard | |
setwd("/sdcard/R") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################### | |
#### CAPTURE ARTICLE INFO, IMPACT FACTORS FROM PMIDs #### | |
######################################################### | |
# Script to retrieve and organise publications data from PubMed (http://www.ncbi.nlm.nih.gov/pubmed) | |
# Uses the function ReadPubMed from the package RefManageR. It reads the PubMed API similarly to the search engine in PubMed's page. | |
# First, automagically install needed libraries: | |
list.of.packages <- c("RCurl", "RefManageR", "devtools", "plyr", "XML", "data.table") | |
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cSplit <- function(indt, splitCols, sep = ",", direction = "wide", | |
makeEqual = NULL, fixed = TRUE, drop = TRUE, | |
stripWhite = FALSE) { | |
## requires data.table >= 1.8.11 | |
require(data.table) | |
if (!is.data.table(indt)) setDT(indt) | |
if (is.numeric(splitCols)) splitCols <- names(indt)[splitCols] | |
if (any(!vapply(indt[, splitCols, with = FALSE], | |
is.character, logical(1L)))) { | |
indt[, eval(splitCols) := lapply(.SD, as.character), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReadPubMed <- function (query, database = "PubMed", ...) | |
{ | |
.params <- list(...) | |
bad.ind <- which(!names(.params) %in% c("usehistory", "WebEnv", | |
"query_key", "retstart", "retmax", "field", "datetype", | |
"reldate", "mindate", "maxdate")) | |
.parms <- .params | |
if (length(bad.ind)) { | |
warning("Invalid .params specified and will be ignored") | |
.parms <- .parms[-bad.ind] |
OlderNewer