Skip to content

Instantly share code, notes, and snippets.

View jmmateoshggm's full-sized avatar

José María Mateos jmmateoshggm

  • Laboratorio de Imagen Médica, Hospital General Universitario Gregorio Marañón
  • Madrid, Spain
View GitHub Profile
@jmmateoshggm
jmmateoshggm / baplot.R
Created May 17, 2013 13:32
Bland-Altman plot, R code.
# Bland-Altman plot R function.
# Author: jmmateos@mce.hggm.es
baplot <- function(m1, m2, ...) {
# m1 and m2 are the measurements
means <- (m1 + m2) / 2
diffs <- m1 - m2
mdiff <- mean(diffs)
sddiff <- sd(diffs)
# Compute the figure limits
@jmmateoshggm
jmmateoshggm / clase_R_2014.R
Created February 28, 2014 12:21
Clase R @ LIM 2014
a <- c(4, 6, 3, 7, 3, 6, 3, 0)
mean(a)
sd(a)
median(a)
var(a)
a[1]
a[1:4]
a[c(1, 3, 8)]
# Comentario. Esto no se ejecuta.