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
############################################ | |
### Reshaping data from IDIS Excel files ### | |
############################################ | |
# This Gist arranges Excel format in a suitable way for creating matrices, adjacency matrices, etc | |
# Based on a Gist recently created by Aurora Baluja | |
# The example uses an excerpt from a real database belonging to the Health Research Institute of Santiago de Compostela | |
# https://gist.github.com/aurora-mareviv/5572111#file-gistfile1-r | |
# First, let's access the datasheet data stored in a remote repository: |
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
# | |
library(stringr) | |
# | |
language <- c('en','es','gl') | |
# | |
for (lan in language) | |
{ | |
url <- paste("http://atriumkm.idisantiago.es/bin/get/XWQL/idisAreas?language=",lan,"&outputSyntax=plain",sep = '') | |
assign(paste("IDISareas",str_to_title(lan),sep = ''), read.table(url, header = TRUE, sep = ';', encoding = 'UTF-8', row.names = NULL)) | |
} |
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
<!-- | |
http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/ | |
http://rpubs.com/rrodriguez/ggplot2_colors | |
http://www.springer.com/gp/book/9780387245447 | |
--> | |
--- | |
output: html_document | |
--- |
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
ftp http://cran.es.r-project.org/src/contrib/XML_3.98-1.7.tar.gz | |
R CMD INSTALL XML_3.98-1.7.tar.gz | |
ftp http://www.rforge.net/Cairo/snapshot/Cairo_1.5-9.tar.gz | |
R CMD INSTALL Cairo_1.5-9.tar.gz | |
ftp http://www.rforge.net/Rserve/snapshot/Rserve_1.7-3.tar.gz | |
R CMD INSTALL Rserve_1.7-3.tar.gz | |
ftp http://www.rforge.net/FastRWeb/snapshot/FastRWeb_1.1-1.tar.gz |
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
# | |
## Introduction to R | |
## by | |
# | |
## Grammar of Graphics | |
## https://ramnathv.github.io/pycon2014-r/visualize/ggplot2.html | |
# | |
data(tips, package = 'reshape2') | |
library(ggplot2) | |
qplot(total_bill, tip, data = tips, geom = "point") |
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
# | |
## Filter, Piping and GREPL Using R DPLYR - An Intro | |
## http://neondataskills.org/R/GREPL-Filter-Piping-in-DPLYR-Using-R/ | |
## | |
# | |
library(dplyr) | |
library(openxlsx) | |
# | |
IDISpublications[which((IDISpublications$yearPublication == 2017) && grepl("blocks",IDISpublications$title)),c('title')] | |
# |
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
mod = function(x) {if (x < 0) {mod <- x*(-1)} else {mod <- x}} | |
f = function(x) {f <- mod(x)/x} | |
x <- seq(-1,1,0.01) | |
x | |
y <- f(x) | |
y | |
plot(f,xlim = c(-1,1)) | |
remove(x,y,f,mod) |
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
year,origin,source,scope,amount | |
2012,public,compet,euun,18900 | |
2012,public,compet,nati,492500 | |
2012,public,compet,regi,80000 | |
2013,public,compet,euun,97000 | |
2013,public,compet,nati,721500 | |
2013,public,compet,regi,914000 | |
2014,public,compet,euun,108119 | |
2014,public,compet,nati,963962 | |
2014,public,compet,regi,149963 |
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
year,tnoa,top25,top10,top5,ncit20160610183600SCQ | |
2012,157,136,111,,4287 | |
2013,198,157,116,,4832 | |
2014,189,159,123,,2439 | |
2015,144,114,59,,1357 | |
2016,169,139,100,21, | |
2017,176,150,123,26, |
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
**Social Sciences and Humanities | |
Barcelona Graduate School of Economics (Barcelona GSE) | |
Basque Centre on Cognition, Brain and Language (BCBL) | |
Centre for Monetary and Financial Studies (CEMFI) | |
Universidad Carlos III de Madrid - Departamento de Economía (ECO-UC3M) | |
**Maths, Experimental Sciences and Engineering | |
Barcelona Supercomputing Center - Centro Nacional de Supercomputación (BSC) | |
Basque Centre for Applied Mathematics (BCAM) | |
Catalan Institute of Nanoscience and Nanotechnology (ICN2) | |
High Energy Physics Institute at the Universitat Autònoma de Barcelona (IFAE - UAB) |
OlderNewer