knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "figures/"
)
library(dplyr)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Reoport" | |
author: "Stanislaus Stadlmann" | |
date: "9/20/2018" | |
output: pdf_document | |
always_allow_html: yes | |
--- | |
```{r} | |
library("plotly") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### speedrun.com tinkering ### | |
## Libraries ## | |
library(jsonlite) | |
library(ggplot2) | |
library(dplyr) | |
library(lubridate) | |
library(data.table) | |
library(viridis) |