Skip to content

Instantly share code, notes, and snippets.

View Stan125's full-sized avatar
👀

Stanislaus Stadlmann Stan125

👀
View GitHub Profile
@Stan125
Stan125 / top20subs.R
Created April 24, 2020 05:39
Script to create graph "Top 20 Areas affected by Coronavirus per 1000 citizens"
#### Making barplots of largest affected areas #####
## Libraries
library("ggplot2")
library("dplyr")
library("readxl")
## Read Data
link1 <- "https://data.nsw.gov.au/data/dataset/aefcde60-3b0c-4bc0-9af1-6fe652944ec2/resource/21304414-1ff1-4243-a5d2-f52778048b29/download/covid-19-cases-by-notification-date-and-postcode-local-health-district-and-local-government-area.csv"
link2 <- "https://www.ausstats.abs.gov.au/ausstats/subscriber.nsf/0/2658B9B8CC9269F7CA2584640014C2C4/$File/32350ds0003_lga_2018.xls"
## Stems Count in Los Angeles Subway Sandwiches ##
## taken from video - https://www.youtube.com/watch?v=4vtbkW4-9EY
# Libraries
library("ggplot2")
# Data
stem_count <- c(2, 0, 1, 3, 4, 5, 2, 1, 4, 4, 1, 6, 2, 1, 2, 3, 3, 2, 4, 3)
stem_data <- data.frame(stem_co = stem_count,
sandwich = seq_len(length(stem_count)))
# This script shows an error in my package distreg.vis
library(distreg.vis)
library(bamlss)
fam_name <- "gamma"
art_data <- model_fam_data(fam_name = fam_name)
fam_called <- do.call(get(paste0(fam_name, "_bamlss"),
envir = as.environment("package:bamlss")),
args = list())
@Stan125
Stan125 / Problem.Rmd
Last active September 20, 2018 14:35
---
title: "Reoport"
author: "Stanislaus Stadlmann"
date: "9/20/2018"
output: pdf_document
always_allow_html: yes
---
```{r}
library("plotly")
library("distreg.vis")
library("gamlss")
library("bamlss")
library("dplyr", warn.conflicts = FALSE)
### Fit a Lognormal model
wage <- ISLR::Wage
model <- gamlss(wage ~ year + ps(age) + education,
~ year + ps(age), data = wage,
family = "LOGNO")
ndata <- wage %>%
@Stan125
Stan125 / RStudio_bamlss.vis_unititled_29180E01
Last active April 26, 2018 08:19
Use `gamlss.dist` and `bamlss` to get all possible distributional regression distributions
library(gamlss.dist)
library(bamlss)
### how many gamlss.dist families are there? ###
funs <- ls(envir = as.environment("package:gamlss.dist"))
funs <- funs[!grepl("d", funs)]
funs <- funs[!grepl("p", funs)]
funs <- funs[!grepl("q", funs)]
funs <- funs[!grepl("r", funs)]
funs <- funs[-c(1, 2)] # exclude helper functions
### speedrun.com tinkering ###
## Libraries ##
library(jsonlite)
library(ggplot2)
library(dplyr)
library(lubridate)
library(data.table)
library(viridis)

R Notebook

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "figures/"
)
library(dplyr)