Skip to content

Instantly share code, notes, and snippets.

View mbojan's full-sized avatar

Michał Bojanowski mbojan

View GitHub Profile
View nyt-spiral.R
library(dplyr)
library(ggplot2)
rawdata <- readr::read_csv(
"https://github.com/CSSEGISandData/COVID-19/raw/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv",
col_types = paste(rep(c("c", "d"), c(2, 790)), collapse="")
)
dat <- rawdata |>
filter(`Country/Region` == "Poland") |>
@mbojan
mbojan / ical2csv.R
Last active October 17, 2019 23:06
Parse (broken) iCal to CSV suitable for Google Calendar
View ical2csv.R
library(ical)
library(dplyr)
library(tidyr)
library(lubridate)
d <- list.files("~/Downloads", "^[0-9]+.ics$", full.names = TRUE) %>%
lapply(ical::ical_parse_df) %>%
lapply(mutate_if, is.factor, as.character) %>%
bind_rows() %>%
as_tibble()
@mbojan
mbojan / rpm.R
Created March 27, 2017 08:47 — forked from zhilongjia/rpm.R
rpm is revised to convert Rnw to Rmd for vignette, originally from https://github.com/leonawicz/ProjectManagement. Main function is convertDocs.
View rpm.R
# @knitr template_objects
# For package 'rpm'
# data
rmd.template <-
'\n
## Introduction
ADD_TEXT_HERE
@mbojan
mbojan / imputation.R
Created June 8, 2016 07:28
Imputation
View imputation.R
# Jako notebook w RStudio (Ctrl+Shift+K)
suppressPackageStartupMessages({
library(MASS)
library(dplyr)
library(tidyr)
library(ggplot2)
library(mice)
})
@mbojan
mbojan / zespol.R
Last active August 29, 2015 14:22
Rysowanie zespolow bezposrednio z 'obrazki' na Google drive
View zespol.R
# zainstalować 'googlesheets' jeśli nie ma
devtools::install_github("jennybc/googlesheets")
library(googlesheets)
library(igraph)
library(scales)
# autoryzacja
gs_auth()
View rcolorsheet.R
library(RColorBrewer)
library(colorRamps)
pdf("rcolorsheet.pdf", paper="a4r", width=11.6, height=8.2, onefile=TRUE)
### page 1
# grDevices::colors
m <- matrix(1:660, 60, 11)