Skip to content

Instantly share code, notes, and snippets.

View sebastiansauer's full-sized avatar
🇺🇦
🇺🇦

Sebastian Sauer sebastiansauer

🇺🇦
🇺🇦
View GitHub Profile
MLE Binomial Shiny App
Base R code created by Gail Potter
Shiny app files created by Gail Potter
---
name: ggplotly
layout: post
title: Make your ggplots shareable, collaborative, and with D3
date: 2014-04-17
author: Matt Sundquist
authorurl: https://plot.ly/team
tags:
- R
- API
@sebastiansauer
sebastiansauer / automated_reporting_latex_r_knitr.Rnw
Created November 27, 2015 12:02
Automated reporting: onepager Latex+R+knitr
\documentclass{article}
\usepackage[margin=2cm,noheadfoot]{geometry}
%\usepackage{fancyhdr}
%\pagestyle{fancyplain}
\usepackage{eso-pic}
@sebastiansauer
sebastiansauer / Rcmdr_troubleshooting.md
Last active April 3, 2016 19:10
R-Commander Troubleshooting

R-Commander Troubleshooting

PROBLEM: R-Commander startet nicht

##--- Alle Betriebssysteme ---

  1. Ist das Betriebssystem aktuell? Ggf. aktualisieren.
  2. Ist R aktuell? Ggf. aktualisieren.
plot_beta <- function(mean_1 = 0, mean_2 = 1,
sd_1 = 1, sd_2 = 1,
fill_alpha = "red",
fill_beta = "green",
alpha = .05, zend = 3,
title = ""){
# plots alpha error and beta error in two normal curves
# arguments:
# normal distribution with serveral shaded areas
library(ggplot2)
library(dplyr)
mean.1 <-0
sd.1 <- 1
zstart <- 2
zend <- 3
zcritical <- 1.65
@sebastiansauer
sebastiansauer / grade_exam.R
Created May 20, 2016 08:28
This gist provides a convenience function for a typical teacher duty: grade exams.
# Exam grading, as a convenience function for teachers
# Sebastian Sauer
# Stand: 2016-05-20
# need to be installed upfront with "install.packages()"
library(ggplot2)
library(car)
library(tidyr)
@sebastiansauer
sebastiansauer / normal_distribution_ggplot.R
Created June 22, 2016 21:22
plot normal distribution with ggplot2, simply
# plot normal distribution with ggplot2, simply
library(cowplot)
p1 <- ggplot(data = data.frame(x = c(-3, 3)), aes(x)) +
stat_function(fun = dnorm, n = 101, args = list(mean = 0, sd = 1)) + ylab("") +
scale_y_continuous(breaks = NULL)
p1
@sebastiansauer
sebastiansauer / Makefile
Created June 22, 2016 21:41 — forked from lmullen/Makefile
PDF slides and handouts using Pandoc and Beamer
SLIDES := $(patsubst %.md,%.md.slides.pdf,$(wildcard *.md))
HANDOUTS := $(patsubst %.md,%.md.handout.pdf,$(wildcard *.md))
all : $(SLIDES) $(HANDOUTS)
%.md.slides.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -o $@
%.md.handout.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -V handout -o $@
@sebastiansauer
sebastiansauer / barplot_with_exact_figures.R
Created June 28, 2016 12:00
Barplot with exact numbers printed in plot
#Barplots with exact numbers
data(tips, package = "reshape2") # load some data
library(dplyr)
library(tidyr)
library(ggplot2)
tips %>%