Skip to content

Instantly share code, notes, and snippets.

@petbadger
petbadger / AddToVScodeSettings.json
Created August 7, 2023 14:51
VScode New Line helper
"editor.rulers": [
{
"_comment1": "JSON does not handle comments, it must also be data",
"_comment2": "This editor ruler adds a vertical line to VSCode to know when to move code to a new line",
"_comment3": "Add this to your settings.json",
"column": 79,
"color": "#FF00FF"
}
]
@petbadger
petbadger / Longitudinal data example.R
Created February 2, 2016 18:02 — forked from johncolby/Longitudinal data example.R
An example showing how to plot longitudinal data in R using base graphics and ggplot2
library(plyr)
library(ggplot2)
# Simulate data
numSubs = 40
x = runif(numSubs, 0, 30)
x = c(x, x + abs(rnorm(numSubs, 2)))
y = 2 + x - 0.02*x^2 + rnorm(2*numSubs, 0, 1)