This file contains hidden or 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(tidyverse) | |
library(FinancialMath) | |
library(FinCal) | |
library(writexl) | |
# loan parameters | |
loan_amount = 4.8e6 | |
roi_0 = 0.0925 | |
tenure_0 = 48 |
This file contains hidden or 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(wakefield) | |
df_foo = r_series(rnorm, 10, 1000) | |
# create quantized versions of base variables | |
df_foo %>% | |
mutate_each( | |
funs(Quantized = . > 0) | |
) |
This file contains hidden or 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(tidyverse) | |
library(modelr) | |
library(lazyeval) | |
library(purrr) | |
# create the dataset | |
df_foo = wakefield::r_data_frame( | |
n = 100, | |
wakefield::r_series(wakefield::r_sample, j = 5, name = "cat"), | |
Y = wakefield::normal() |
This file contains hidden or 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(ggplot2) | |
library(dplyr) | |
library(scales) | |
df_foo = data_frame( | |
var1 = sample(LETTERS[1:4], size = 100, replace = TRUE), | |
var2 = sample(letters[1:4], size = 100, replace = TRUE) | |
) | |
# stacked absolute bar chart |
This file contains hidden or 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(ggplot2) | |
library(grid) | |
library(tidyr) | |
library(gtable) | |
library(dplyr) | |
gg_foo3_colors = c("#F8766D", "#00BFC4") | |
df_foo = read.csv(text = ",Russia,World | |
1996,0,423 |
This file contains hidden or 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
Once, Fermat contrariated Gauss, and the result was "The Last Fermat Theorem" (bye bye Fermat!) | |
Gauss had already known the website 'Gauss Facts', so he saved his time for an autobiography. | |
Gauss can walk through Konigsberg crossing its bridges once and only once | |
Gauss knows an algorithm to compute the class group of any normal variety. | |
Gauss once proved the Fundamental Theorem of Algebra by explicitly writing out every nonconstant polynomial over the complex numbers and writing each as a product of linear factors. | |
Gauss once determined whether P = NP, but didn't think it was important enough to publish. | |
Gauss can prove axioms. | |
A mathematician, a physicist, and an engineer walk into a bar. The bartender says, "Hello, Professor Gauss." | |
Gauss can invert matrices even if its determinant is zero. | |
Gauss solves Navier-Stokes equations by hand. |
This file contains hidden or 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
user www-data; | |
worker_processes 4; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { |
This file contains hidden or 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
alabaster==0.7.7 | |
awscli==1.6.2 | |
Babel==2.3.3 | |
backports-abc==0.4 | |
backports.shutil-get-terminal-size==1.0.0 | |
backports.ssl-match-hostname==3.4.0.2 | |
bcdoc==0.12.2 | |
boto==2.33.0 | |
botocore==0.73.0 | |
certifi==2015.4.28 |
This file contains hidden or 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
#============================================================================== | |
# purpose: get the column number from the column name in Excel | |
# author: tirthankar chakravarty | |
# created: 22nd february 2016 | |
# revised: 22nd february 2016 | |
# comments: | |
# - based on this SO answer: http://stackoverflow.com/a/1004624/1414455 | |
#============================================================================== | |
excel_name_to_number = function(name) { |
This file contains hidden or 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
# http://chat.stackoverflow.com/transcript/message/28317173#28317173 | |
# the list() invocation creates a list but that is not assigned to the | |
# local namespace. append() changes it but does not return the | |
# the original object which is now lost | |
bar = list(range(0,8)).append(23) | |
print(bar) | |
# this breaks down the creation and the mutation into two | |
foo = list(range(0,8)) | |
foo.append(23) |
NewerOlder