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
--- | |
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 |
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
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
--- | |
title : RevealJS with Bootstrap | |
framework : revealjs | |
widgets : [bootstrap] # {mathjax, quiz, bootstrap} | |
--- | |
## Read-And-Delete | |
1. Edit YAML front matter | |
2. Write using R Markdown |
-
iTerm2
-
Command Line Tools
xcode-select –install
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)
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(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( |
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
example.md: example.Rmd | |
./knit | |
example.ipynb: example.md | |
notedown example.md | sed 's/%%r/%%R/' > example.ipynb |
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
""" 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): |
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(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) |