Skip to content

Instantly share code, notes, and snippets.

View tpoisot's full-sized avatar
🌴
On vacation

Timothée Poisot tpoisot

🌴
On vacation
View GitHub Profile
@tpoisot
tpoisot / graph_permut.r
Created November 10, 2014 22:45
Graph permutation with some constraints.
library(igraph)
library(plyr)
nl <- function(gl) sum(aaply(gl, 1, function(x) x[1] == x[2]))
nd <- function(gl) nrow(gl) - nrow(unique(aaply(gl, 1, sort)))
permut_graph <- function(g){
gl <- get.edgelist(g)
L <- nl(gl)
D <- nd(gl)
using Base.Test
using Gadfly
logistic_growth = (x, r) -> r*x*(1-x)
function logistic_map(x::Number, r::Float64, n::Int64)
@test x > 0
@test x <= 1
orbit = zeros(Float64, n)
orbit[1] = x
using Base.Test
using Gadfly
logistic_growth = (x, r) -> r*x*(1-x)
function logistic_map(x::Number, r::Float64, n::Int64)
@test x > 0
@test x <= 1
orbit = zeros(Float64, n)
orbit[1] = x
@tpoisot
tpoisot / credentials.json
Last active August 29, 2015 14:05
Use with ./get_tweets.py 10 3 test.json openscience opendata
{
"c_key": "ConsumerKey",
"c_sec": "ConsumerSecret",
"t_key": "TokenKey",
"t_sec": "TokenSecret"
}
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
day;I
0;1
1;3
2;7
3;25
4;72
5;222
6;282
7;256
8;233
using Distributions
#=
ABC rejection smapling
This code estimates the value of two parameters (optimum and tolerance)
for simulated data of fitness along a gradient of x values. The fitness is
given by a Gaussian function.
[{"DOI": "10.1002/ece3.508", "subtitle": [], "URL": "http://dx.doi.org/10.1002/ece3.508", "issued": {"date-parts": [[2013, 4]]}, "volume": "3", "prefix": "http://id.crossref.org/prefix/10.1002", "id": "Poisot2013", "publisher": "Wiley-Blackwell", "author": [{"given": "Timoth\u00e9e", "family": "Poisot"}, {"given": "B\u00e9rang\u00e8re", "family": "P\u00e9quin"}, {"given": "Dominique", "family": "Gravel"}], "issue": "4", "reference-count": 123, "ISSN": ["2045-7758"], "source": "CrossRef", "score": 1.0, "deposited": {"timestamp": 1372118400000, "date-parts": [[2013, 6, 25]]}, "container-title": "Ecol Evol", "indexed": {"timestamp": 1400774816596, "date-parts": [[2014, 5, 22]]}, "title": "High-Throughput Sequencing: A Roadmap Toward Community Ecology", "type": "article-journal", "page": "1125-1139"}]
test
~ $ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 24 2014 19:36:05)
Rustines incluses : 1-214
Compilé par Arch Linux
Énorme version avec interface graphique GTK2.
Fonctionnalités incluses (+) ou non (-) :
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
+balloon_eval +float +mouse_urxvt -tag_any_white
@tpoisot
tpoisot / isoclines.r
Created March 18, 2014 23:21
Show isoclines and vector field
library(RColorBrewer)
library(shape)
dndt = function(n1, n2, params)
{
with(as.list(params),{
dn1 = r1 * (1 - (a11 * n1 + a12 * n2)/k1)
dn2 = r2 * (1 - (a22 * n2 + a21 * n1)/k2)
return(list(dn1 = dn1, dn2 = dn2))
})