Skip to content

Instantly share code, notes, and snippets.

View rnfermincota's full-sized avatar
💭
I may be slow to respond.

rnfermincota

💭
I may be slow to respond.
View GitHub Profile
# Vaccination status by age group
#---------------------------------------
rm(list=ls())
graphics.off()
#---------------------------------------
library(cansim)
library(dplyr)
library(ggplot2)
library(readr)
library(tidyr)
@rnfermincota
rnfermincota / separate-unite.R
Last active September 26, 2021 03:54
Separate and unite are complements
rm(list=ls())
#-----------------------------------------------------------------------------
library(dplyr)
library(tidyr)
library(data.table)
#-----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Example5
#----------------------------------------------------------------------------
#-------------------------------------------------------------------------------------
# Source: https://gist.github.com/rnfermincota/5ad446853c5580c3cd561198ee94561e
#-------------------------------------------------------------------------------------
# Written by Rafael Nicolas Fermin Cota
# June 19th, 2022
#-------------------------------------------------------------------------------------
# References:
# [1] Interest Rates, Earning Growth and Equity Value: Investment Implications: https://aswathdamodaran.blogspot.com/2021/03/rates-growth-and-value-investment.html
# [2] Data Update 2 for 2022: US Stocks kept winning in 2021: https://aswathdamodaran.blogspot.com/2022/01/data-update-2-for-2022-us-stocks-kept.html
# [3] Global Interest Rates Dynamics and Inflation Expectations: https://rpubs.com/rafael_nicolas/global_interest_rates_dynamics_inflation
library(httr)
date_to <- Sys.Date(); date_from <- date_to-10
# solve No visible binding for global variable
. <- NULL
# make POST request to invest.com earings calendar
# print("POST request to investing.com")
p <- POST(
url = "https://www.investing.com/earnings-calendar/Service/getCalendarFilteredData",
# Libraries
library(f1db)
library(stringr)
#-----------------------------------------------------------
# Database initialization & connection
con <- f1db_connect()
f1db_collect_tables(con)
# Joins & column selection