Skip to content

Instantly share code, notes, and snippets.

View low-decarie's full-sized avatar

Etienne low-decarie

  • Canadian Space Agency
  • Montreal
View GitHub Profile

How to report statistics in a class report or manuscript

This is a work in progress…feel free to suggest

Relevant to : ecology, evolution, behaviour

  • Provide all the information required (with the exception of data, which should be linked to in a manuscript) to replicate the test in the "Methods". This may include:
    • Description of the model (response variable, explanatory variable, structure)
    • Reference for more exotic tests or for the application of standard tests in a specific context
  • Any data manipulation (transformation, dropped data)
DI
10.1099/ijs.0-011122-0
10.1099/ijs.0.009191-0
10.1099/ijs.0.009779-0
10.1099/ijs.0.011114-0
10.1099/ijs.0.002865-0
10.1099/ijs.0.007013-0
10.1099/ijs.0.006031-0
10.1099/ijs.0.008193-0
10.1099/ijs.0.002527-0
library("tm")
library("SnowballC")
library("wordcloud")
library("RColorBrewer")
#####
# Load ics data using code from
# https://stackoverflow.com/questions/43573982/how-to-import-ical-ics-file-in-r
###
stat_smooth_func <- function(mapping = NULL, data = NULL,
geom = "smooth", position = "identity",
...,
method = "auto",
formula = y ~ x,
se = TRUE,
n = 80,
span = 0.75,
fullrange = FALSE,
level = 0.95,
#Creates a histogram of publications per year from text currently in the clipboard. Must be edited for mac or windows.
require(stringr)
require(ggplot2)
#on windows
#text <- readLines("clipboard")
#for a mac
######################################
## Function that organizes the data so that PGLMM can be fit
## Created by Matthew Helmus
##
## attempt at fixing the function for use with larger data sets
## diag is replaced with Matrix:::Diagonal
######################################
require(Matrix)
######################################
## Function calls a PGLMM for logistic regression
## Created by Matthew Helmus
######################################
PGLMM.fit<-function(dat=NULL,Y=NULL,X=NULL,VV=NULL,sp.init=0.5,maxit=25,exitcountermax=50) # [B,B0,s,S95int,LL,flag]=PGLMM_nosparse_funct(Y,X,VV,s)
{
if (!require(corpcor))
{
stop("The 'corpcor' package is required")
@low-decarie
low-decarie / gg_candisc_plot.R
Created November 13, 2013 13:42
ggplot2 approach to plotting the results of the candisc function found in the candisc package with 95% confidence ellipses. Needs editing to be completely compatible with candisc.
gg.candisc.plot <- function(candisc.object){
# Plot with ellipses using ggplot2 ####
require(grid)
require(ggplot2)
require(devtools)
require(digest)
#For info : http://stackoverflow.com/questions/2397097/how-can-a-data-ellipse-be-superimposed-on-a-ggplot2-scatterplot
source_url("https://raw.github.com/low-decarie/FAAV/master/r/stat-ellipse.R")
@low-decarie
low-decarie / dual_dendogram_tile_plot
Last active July 21, 2023 22:17
Given a data matrix, this produces a tile plot with dendograms for each axis
dual_dendogram_tile_plot <- function(data.matrix, main="Title"){
#Dual dendrogram ############
x <- data.matrix
dd.col <- as.dendrogram(hclust(method="ward",dist(x)))
col.ord <- order.dendrogram(dd.col)
dd.row <- as.dendrogram(hclust(method="ward",dist(t(x))))
row.ord <- order.dendrogram(dd.row)
tell application "Microsoft PowerPoint"
activate
set theView to view of document window 1
repeat with slideNumber from 1 to count of slides of active presentation
go to slide theView number slideNumber
tell slide slideNumber of active presentation