test<-mtcars
test[2,] <- NA
head(test)
# mpg cyl disp hp drat wt qsec vs am gear carb
# Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
# Mazda RX4 Wag NA NA NA NA NA NA NA NA NA NA NA
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
background #faf6f3 | |
foreground #4f2e18 | |
selection_background #4d4d4c | |
selection_foreground #ffffff | |
#: black | |
color0 #282828 | |
color8 #928374 | |
#: red | |
color1 #cc241d |
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
#!/usr/bin/env bash | |
############################################################################### | |
# _ _ _ _ __ _ # | |
# | |__ ___ _ __| |__ ___| |_| |_ _ / _| |_ _ _ _ __ ___ # | |
# | '_ \ / _ \ '__| '_ \/ __| __| | | | | |_| __| \ /\ / | '_ ` _ \ # | |
# | | | | __/ | | |_) \__ \ |_| | |_| | _| |_ \ V V /| | | | | | # | |
# |_| |_|\___|_| |_.__/|___/\__|_|\__,_|_| \__| \_/\_/ |_| |_| |_| # | |
# # | |
############################################################################### | |
# Initialise {{{ |
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
```let | |
pkgs = import <nixpkgs> {}; | |
in | |
pkgs.mkShell { | |
buildInputs = with pkgs; [ | |
python37 | |
python37Packages.pandas | |
python37Packages.numpy | |
python37Packages.rpy2 | |
python37Packages.matplotlib |
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(rvest) | |
library(tidyverse) | |
# html scraper is a function of the url and the element of the list | |
html_scraper <- function(url, elem){ | |
read_html(url) %>% html_nodes("table") %>% . [[elem]] %>% html_table -> out | |
return(out) | |
} | |
# usage | |
# html_scraper( 'http://pokemondb.net/pokedex/all' , 1 ) |
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
#!/usr/bin/env bash | |
# | |
# Source: | |
# https://gitlab.com/gaugek/dots/ | |
# | |
dir="$HOME/Videos/recordings" | |
name="$(date '+%Y-%m-%d.%H:%M:%S')" # Needs .mp4 after this is listed in the actual recording part | |
re="\e[31m" |
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
arpgen <- function(phi,vec,l,mu){ | |
v <- vec[length(vec):(length(vec)-(length(phi)-1))] | |
f <- sum(phi*(v)) + mu*(1-sum((phi))) | |
if (l==1) return(f) | |
return(arpgen(phi,append(vec,f),l-1,mu)) | |
} | |
arp <- function(phi,vec,l,mu){ | |
as.numeric(lapply(1:l, arpgen, phi = phi, vec = vec, mu = mu)) |
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(dplyr) # so we can use %>% pipes! | |
rawBeer <- read.csv(file = "../data/raw/Beers.csv",header=TRUE, sep=",",stringsAsFactors=FALSE) | |
rawBrew <- read.csv(file= "../data/raw/Breweries.csv", header=TRUE, sep=",", stringsAsFactors=FALSE) | |
head(rawBeer) | |
# Name Beer_ID ABV IBU Brewery_id Style | |
# 1 Pub Beer 1436 0.050 NA 409 American Pale Lager | |
# 2 Devil's Cup 2265 0.066 NA 178 American Pale Ale (APA) | |
# 3 Rise of the Phoenix 2264 0.071 NA 178 American IPA | |
# 4 Sinister 2263 0.090 NA 178 American Double / Imperial IPA | |
# 5 Sex and Candy 2262 0.075 NA 178 American IPA |
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
beersong <- function(n=99) { | |
if (n==1) { | |
cat("\n",n," bottle of beer on the wall, ",n, | |
" bottles of beer.\nTake one down and pass it around,", | |
" no more bottles of beer on the wall.\n", sep="") | |
cat("\nNo more bottles of beer on the wall, no more bottles of beer.\n", | |
"Go to the store and buy some more, 99 bottles of beer on the wall.\n", sep="") | |
} else { | |
cat("\n",n," bottles of beer on the wall, ",n, | |
" bottles of beer.\nTake one down and pass it around, ", |
OlderNewer