- Does the project contain R script?
- Does the project contain data?
- Does the project contain a test script?
- Do the scripts contain proper comments?
- Is the project organised in proper structure?
- Do the scripts follow R style guide?
http://style.tidyverse.org/
- Does the README display the project structure?
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(shiny) | |
ui <- fluidPage( | |
column(12, | |
# toggle between normal or uniform distribution | |
actionButton("rnorm", "Normal"), | |
actionButton("runif", "Uniform") | |
), | |
column(12, | |
plotOutput("plot") |
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
#-- BASED ON https://cloud.google.com/vision/docs/request#json_request_format --# | |
# image url on Google Cloud Storage | |
imgURI <- "gs://vacation_room/dublin-001.jpg" | |
# Requests are POST requests to | |
endpoint <- "https://vision.googleapis.com/v1/images:annotate" | |
#### remember to set api token in ``options`` | |
# options(gcv_api_token = "YOUR_API_TOKEN") |
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
#!/bin/bash | |
# Header | |
echo `date` | |
if [ -d .git ];then | |
echo -e "\n\033[0;42m **** Current Status ****\033[0m\n" | |
git status -s | |
echo -e "\n\033[0;43m **** Pending Issue ****\033[0m\n" |
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
#!/bin/bash | |
function _awsSwitchProfile() { | |
# Check if argument exists | |
if [ -z $1 ]; then echo "Usage: _awsSwitchProfile <profilename>"; return; fi | |
# Check if profile exists | |
exists="$(aws configure get aws_access_key_id --profile $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
# China Outbound Tourism | |
library(readxl) | |
library(tidyr) | |
library(ggplot2) | |
library(broom) | |
# read data | |
cot <- read_excel("~/Downloads/outbound_tourism_china.xlsx", skip = 5) | |
# mod columns name | |
colnames(cot) <- c("country", "series", 1995:2016, "pct_chg_16_15") |
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 Rscript --vanilla | |
args <- commandArgs(trailingOnly = TRUE) | |
# List all files | |
items <- list.files(path = ".") | |
# See which matches argument (regex) | |
old <- items[grep(items, pattern = args[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
library(readxl) | |
library(tidyr) | |
library(ggplot2) | |
library(broom) | |
library(rvest) | |
library(plotly) | |
# Import data ------------------------------------------------------------- |
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(httr) | |
library(dplyr) | |
# Find out which cities are being covered in China | |
china <- "https://api.openaq.org/v1/cities?country=CN" | |
china_df <- GET(china) %>% content("parsed") %>% `[[`('results') %>% bind_rows() | |
# Main interest | |
cities <- c("Beijing", "Shanghai", "Guangzhou") | |
china_df %>% filter(city %in% cities) |
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
# Mon Feb 12 16:48:40 2018 ------------------------------ | |
library(tidyverse) | |
library(wbstats) | |
set.seed(1234) | |
# GDP per capita | |
gdp <- wb(indicator = "NY.GDP.PCAP.CD") %>% as.tibble() | |
skimr::skim(gdp) |
OlderNewer