Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ramnathv's full-sized avatar

Ramnath Vaidyanathan ramnathv

View GitHub Profile
@ramnathv
ramnathv / nyc_tlc.Rmd
Created May 21, 2022 18:04 — forked from lambiase/nyc_tlc.Rmd
New York City Taxi & Limousine Commission (TLC) Trip Data Analysis Using Sparklyr and Google BigQuery
---
title: New York City Taxi & Limousine Commission (TLC) Trip Data Analysis Using Sparklyr
and Google BigQuery
author: "Mirai Solutions"
date: 8\textsuperscript{th} January 2018
output:
html_document:
theme: flatly
params:
# gcp_json_keyfile: gcp_keyfile.json
@ramnathv
ramnathv / README.md
Last active April 8, 2022 11:17
Parser to Convert Markdown to CTV file.

This is a proof-of-concept of a parser to convert a markdown file to a ctv file, that is required for task views. The basic idea is to use a combination of YAML and markdown sections in the md file, parse it and convert it into a payload, and render it using a template as specified by the ctv package.

Structure of Markdown File

---
name: Working with data on the web
maintainer: Scott Chamberlain, Karthik Ram, Christopher Gandrud
email: scott at ropensci.org
version: 2013-09-17
@ramnathv
ramnathv / index.Rmd
Last active March 23, 2021 17:15
RevealJS with Bootstrap Columns
---
title : RevealJS with Bootstrap
framework : revealjs
widgets : [bootstrap] # {mathjax, quiz, bootstrap}
---
## Read-And-Delete
1. Edit YAML front matter
2. Write using R Markdown

App Install Plan

Critical

@ramnathv
ramnathv / README.md
Created February 2, 2016 21:42
Plotly Hover Events in Shiny

This is a demo of how to get plotly events back to shiny server.

Let us start by loading required libraries and preparing data. We use the ubiquitous mtcars dataset.

# Load Libraries ----
library(plotly)
library(shiny)
library(htmlwidgets)
@ramnathv
ramnathv / code.R
Created October 17, 2013 09:45
GDP of Top 10 Countries
library(WDI)
top10 = c('US', 'CN', 'JP', 'DE', 'FR', 'GB', 'BR', 'RU', 'IT', 'IN')
gdp = WDI(top10, indicator = "NY.GDP.MKTP.CD", start = 1980, end = 2012)
gdp = transform(gdp, NY.GDP.MKTP.CD = NY.GDP.MKTP.CD/10^9)
library(rCharts)
n1 <- nPlot(NY.GDP.MKTP.CD ~ year, data = gdp, group = 'country',
type = 'stackedAreaChart', width = 800, height = 400
)
n1$yAxis(
@ramnathv
ramnathv / Makefile
Last active January 16, 2021 13:47
R Markdown to IPython Notebook
example.md: example.Rmd
./knit
example.ipynb: example.md
notedown example.md | sed 's/%%r/%%R/' > example.ipynb
@ramnathv
ramnathv / bm25.py
Created September 8, 2020 04:25 — forked from koreyou/bm25.py
Implementation of OKapi BM25 with sklearn's TfidfVectorizer
""" Implementation of OKapi BM25 with sklearn's TfidfVectorizer
Distributed as CC-0 (https://creativecommons.org/publicdomain/zero/1.0/)
"""
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
from scipy import sparse
class BM25(object):
@ramnathv
ramnathv / datasaurus.R
Created May 3, 2017 22:56
Datasaurus in R
library(ggplot2)
library(datasauRus)
library(gganimate)
p <- ggplot(datasaurus_dozen, aes(x = x, y = y, frame = dataset)) +
geom_point() +
theme(legend.position = "none")
gganimate(p, title_frame = FALSE)