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
#Dataset description | |
library(plyr); library(dplyr) | |
library(ggplot2) | |
setwd("~/Desktop/student") | |
d1_mat=read.csv("student-mat.csv", sep=';', header=T, stringsAsFactors = F) | |
d2_por=read.csv("student-por.csv", sep=';', header = T, stringsAsFactors = F) | |
data=merge(d1_mat,d2_por,by=c("school", "sex", "age", "address", "famsize", | |
"Pstatus","Medu", "Fedu", "Mjob", "Fjob", "reason", | |
"nursery", "internet")) | |
summary(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(plotly) | |
library(dplyr) | |
library(ggmap) | |
library(map) | |
library(googleVis) | |
library(ggplot2) | |
library(leaflet) | |
library(lattice) | |
library(plyr) | |
library(Rmisc) |
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
device_data=read.csv('./data/phonedata.csv', header=T, stringsAsFactors = F) | |
device_map=dplyr::filter(device_data, !is.na(longitude), !is.na(latitude), !is.na(group))%>% | |
dplyr::filter(longitude>=73, longitude<136, latitude>=4, latitude<54) | |
N=nrow(device_map) | |
agegroup=rep(0, N) | |
for (i in 1:N){ | |
if (device_map$age[i]<=26){ | |
agegroup[i]='post-90s' | |
} | |
else if (device_map$age[i]>26&device_map$age[i]<=36){ |
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
app_data=read.csv('./data/appmap.csv', header=T, stringsAsFactors = F) | |
#str(app_data) | |
app_map=dplyr::filter(app_data, !is.na(longitude), !is.na(latitude), !is.na(group))%>% | |
dplyr::filter(longitude>=73, longitude<136, latitude>=4, latitude<54) | |
#str(app_map) | |
N1=nrow(app_map) | |
agegroup1=rep(0, N1) | |
for (i in 1:N1){ | |
if (app_map$age[i]<=26){ |
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(dplyr) | |
library(wordcloud) | |
library(RColorBrewer) | |
library(shinythemes) | |
device_data=read.csv('./data/phonedata.csv', header=T, stringsAsFactors = F) | |
#str(device_data) | |
device_map=dplyr::filter(device_data, !is.na(longitude), !is.na(latitude), !is.na(group))%>% | |
dplyr::filter(longitude>=73, longitude<136, latitude>=4, latitude<54) | |
#str(device_map) |
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) | |
library(shinydashboard) | |
library(dplyr) | |
library(leaflet) | |
library(googleVis) | |
library(plotly) | |
library(wordcloud) | |
library(RColorBrewer) | |
library(shinythemes) |
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) | |
library(dplyr) | |
library(leaflet) | |
library(ggplot2) | |
library(plotly) | |
library(googleVis) | |
library(wordcloud) | |
library(RColorBrewer) | |
library(shinythemes) |
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
from bs4 import BeautifulSoup | |
import urllib2 | |
web='http://www.sports-reference.com/olympics/summer/2012/' | |
req = urllib2.Request(web) | |
page = urllib2.urlopen(req) | |
soup = BeautifulSoup(page, "lxml") | |
table = soup.find("div", { "class" : "table_container" }) | |
cells=[] | |
for row in table.findAll("tr"): | |
result = row.findAll("td") |
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
setwd("~/Desktop/web scraping") | |
library(dplyr) | |
library(dygraphs) | |
library(reshape2) | |
library(ggplot2) | |
library(plotly) | |
library(car) | |
library(TSA) | |
library(forecast) | |
library(xts) |
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
setwd("~/Desktop/web scraping") | |
library(ggplot2) | |
library(data.table) | |
library(dygraphs) | |
library(dplyr) | |
swimming=read.csv('swimming.txt', header=T, stringsAsFactors = F) | |
nrow(swimming) | |
View(swimming) | |
summary(swimming) | |
ss=swimming%>% |
OlderNewer