Skip to content

Instantly share code, notes, and snippets.

sp_by_hour <- data%>% mutate_at(vars(Species),factor)%>%
group_by(Station,Species,.drop=FALSE)%>%
mutate(hora=hour(DateTimeOriginal))%>%
filter(Species=='fox'|Species=='people')
sp_by_hour_plot <- ggplot(sp_by_hour, aes(x =hora, fill = Species)) +
geom_bar(width = .95) +
coord_polar(start = 0) +
theme_minimal() +
scale_fill_manual(values = alpha(c("blue", "red"), .5)) +
@lsaravia
lsaravia / FiresByYear.r
Last active January 5, 2020 18:12
Minimal analysis of Australian fires (as number of detections)
#
# Australian fires by year 2014 - 2019
#
# Data downloaded from http://viirsfire.geog.umd.edu/map/viirsMap.php
#
require(ggplot2)
require(readr)
require(dplyr)
require(plyr)
require(siar)
t1 <- data.frame(SizeClass=c("Meiofauna","Smaller Macrofauna","Bigger Macrofauna"),
num=rpois(3,10),
md13C=rnorm(3,-10,10),
sd13C=rlnorm(3,1,1),
md15N=rnorm(3,5,5) ,
sd15N=rlnorm(3,1,1))
t1
@lsaravia
lsaravia / test_siber.hull.metrics.r
Created June 16, 2015 13:22
Test siber.hull.metrics from SIAR R package
require(plyr)
require(siar)
t1 <- data.frame(SizeClass=c("Meiofauna","Smaller Macrofauna","Bigger Macrofauna"),
num=rpois(3,10),
md13C=rnorm(3,-10,10),
sd13C=rlnorm(3,1,1),
md15N=rnorm(3,5,5) ,
sd15N=rlnorm(3,1,1))
t1
@lsaravia
lsaravia / replace_center.py
Created February 20, 2013 19:17
A python script to transform <center>![Caption](figs/figure.png)</center> to \centerline{\includegraphics[height=1.5in]{figs/figure.png}} done by guys at http://software-carpentry.org/bootcamps/office-hours.html. This is useful to transform markdown slides written to generate HTML slides, to slides for beamer http://waterthinking.blogspot.com.ar…
#! /usr/bin/env python
import sys
import re
Usage = """ run with the source file as an argument
capture the output with redirection >
takes a file with image source in <center> tags,
either on 3 lines or one, and reformats to one line
As per the OutString variable"""
if len(sys.argv)<2:
sys.stderr.write(Usage)
@lsaravia
lsaravia / RAE2012_DivPatron_charla_beamer.Rmd
Created October 27, 2012 04:29
R Markdown source for RAE2012 talk: Diversidad y Patrón Espacial A Lo Largo De La Sucesión - La Influencia Del Tipo De Dispersión
% Diversidad y Patrón Espacial A Lo Largo De La Sucesión:
La influencia del tipo de dispersión
% Leonardo A. Saravia UNGS - RAE 2012
% \centerline{\includegraphics[height=2in]{figs/Portada.png}}
# Hipótesis
+ El tipo de dispersión es importante para el mantenimiento de la biodiversidad
@lsaravia
lsaravia / DivPatron_charla.Rmd
Created September 30, 2012 19:59
Source of the talk "Diversidad y Patrón Espacial A Lo Largo De La Sucesión" presented at "Reunion Argentina de Ecología 2012"
# Diversidad y Patrón Espacial A Lo Largo De La Sucesión
<center><font color = "grey"> La Influencia Del Tipo De Dispersión</font></center>
<br/>
<center>Leonardo A. Saravia <font color = "blue", size=4> Universidad Nacional de General Sarmiento</font> - RAE 2012![](figs/Portada.png)
</center>
# Hipótesis
+ El tipo de dispersión es importante para el mantenimiento de la biodiversidad