Skip to content

Instantly share code, notes, and snippets.

View mbojan's full-sized avatar

Michał Bojanowski mbojan

View GitHub Profile
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)
@mbojan
mbojan / zespol.R
Last active August 29, 2015 14:22
Rysowanie zespolow bezposrednio z 'obrazki' na Google drive
# zainstalować 'googlesheets' jeśli nie ma
devtools::install_github("jennybc/googlesheets")
library(googlesheets)
library(igraph)
library(scales)
# autoryzacja
gs_auth()
@mbojan
mbojan / imputation.R
Created June 8, 2016 07:28
Imputation
# Jako notebook w RStudio (Ctrl+Shift+K)
suppressPackageStartupMessages({
library(MASS)
library(dplyr)
library(tidyr)
library(ggplot2)
library(mice)
})
@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.
# @knitr template_objects
# For package 'rpm'
# data
rmd.template <-
'\n
## Introduction
ADD_TEXT_HERE
@mbojan
mbojan / ical2csv.R
Last active October 17, 2019 23:06
Parse (broken) iCal to CSV suitable for Google Calendar
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()
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") |>