Skip to content

Instantly share code, notes, and snippets.

@lovelybigdata
lovelybigdata / app.R
Created February 23, 2016 07:59
臺灣地區液化潛能製圖 SHINY R VERSION
library(shiny)
library(leaflet)
library(dplyr)
# read data
df_map <- read.delim("Sheet_R_MAP.csv",stringsAsFactors=FALSE)
# define colorBin
pal <- colorBin(palette=c("green","pink","red","purple"),domain=df_map$Pl,bins=c(0,5,10,15,70),pretty=TRUE,na.color="#808080",alpha=F)
@lovelybigdata
lovelybigdata / 0_reuse_code.js
Created September 29, 2015 16:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
my_news = data.frame(
title = html(news_url) %>% html_nodes(".picword") %>% html_text() ,
title_href = html(news_url) %>% html_nodes(".picword") %>% html_attr( "href") ,
stringsAsFactors=FALSE)
library(rvest)
news_url="http://news.ltn.com.tw/list/BreakingNews"
title_css = html(news_url) %>% html_nodes(".picword") %>% html_text()
my_news = data.frame(title = title_css)
View(my_news)
library(rvest)
news_url="http://news.ltn.com.tw/list/BreakingNews"
title_css = html(news_url) %>% html_nodes(".picword") %>% html_text()
my_news = data.frame(title = title_css)
View(my_news)