ggplot(sorted_top_50,aes(x=colorname,y=count))+
geom_bar(colour=head(colour_hex_strings_all,50),
stat=“identity”,fill=head(colour_hex_strings_all,
50),width=1,position = position_dodge(width = 0.005)+
scale_x_discrete(limits = sorted_top_50$colorname)+theme(
axis.text.x = element_text(angle=90, hjust=1,
vjust=0.5,size=10))
This file contains hidden or 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
Rolands-MBP:BIKETOWORKSHOP_COM_SURGE rolandtanglao$ nslookup t.co | |
Server: 10.244.75.5 | |
Address: 10.244.75.5#53 | |
Non-authoritative answer: | |
Name: t.co | |
Address: 199.59.150.44 | |
Name: t.co | |
Address: 199.59.148.12 |
This file contains hidden or 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
Rolands-MBP:BIKETOWORKSHOP_COM_SURGE rolandtanglao$ curl -ILA "Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12H321 Safari/600.1.4" http://t.co/N9vtiDampH | |
HTTP/1.1 200 OK | |
cache-control: private,max-age=300 | |
content-length: 0 | |
content-type: text/html; charset=utf-8 | |
date: Fri, 21 Aug 2015 23:10:36 GMT | |
expires: Fri, 21 Aug 2015 23:15:36 GMT | |
server: tsa_a | |
set-cookie: muc=131d3196-0696-4b62-b8fd-de52282c4abd; Expires=Wed, 02 Aug 2017 23:10:36 GMT; Domain=t.co | |
x-connection-hash: 87566868df47a46e07b2bb987bdb00f0 |
The following (hmmm jekyll won’t render my html tag correctly; until I get it fixed, you can find the proper html rendering of the notebook here) is an Jupiter(fka iPython) notebook showing how to download and install my instagram Vancouver 2014 top colour dataset in R
r = getOption(“repos”) # hard code the UK repo for CRAN
r[“CRAN”] = “http://cran.uk.r-project.org”
options(repos = r)
rm(r)
install.packages(“ig.vancouver.2014.topcolour”)
This file contains hidden or 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
ggplot(sorted3,aes(x=colorname,y=count,fill=as.character(sorted3$colorname)))+ | |
stat_summary(fun.y=identity,geom="histogram")+ | |
scale_fill_manual(values=c(as.character(sorted3$colorname)),+ | |
name= "My name", guide = guide_legend(reverse = TRUE))+ | |
scale_x_discrete(limits = sorted3$colorname) |
This file contains hidden or 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
sorted = read.csv("/Users/rolandtanglao/Dropbox/PHOTOS/instagram-top10-vancouver-2014/sorted-ig-van-2014-top-colour-names.csv") | |
counts3 = head(sorted[,2],200) | |
colours3 = head(sorted[,1],200) | |
barplot(counts3, main="Colour Distribution", | |
col=colours3, | |
xlab="Top Colours", | |
ylab="Colour Counts") |
This file contains hidden or 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
require("plotrix") | |
tc <- function(x) { | |
return (head(color.id(x),n=1)) | |
} | |
colour_list8000 = dt8000[,tc(colour),by=colour] | |
> head(colour_list8000, n=100 | |
+ ) | |
colour V1 | |
1: #FFFFFF white | |
2: #FEFEFE white |
This file contains hidden or 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
> tc <-function(x) { | |
+ return (head(color.id(x),n=1)) | |
+ } | |
> tc("#fefefe") | |
[1] "white" | |
> tc("#fefeff") | |
[1] "white" | |
> tc("#fefe00") | |
[1] "yellow" | |
> lappy(h$count,tc) |
This file contains hidden or 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
> nearColour <- function(r,g,b){ | |
+ ctable = col2rgb(colors()) | |
+ cdiff = ctable - c(r,g,b) | |
+ cdist = cdiff[1,]*cdiff[1,]+cdiff[2,]*cdiff[2,]+cdiff[3,]*cdiff[3,] | |
+ return(colors()[cdist == min(cdist)]) | |
+ } | |
> rgb2 = col2rgb("#FEFDFC") | |
> rgb2[[1,1]] | |
[1] 254 | |
> rgb2[[2,1]] |
This file contains hidden or 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
counts3 = head(topcolour.ig.vancouver.2014[,2], n=200) | |
barplot(counts3, main="Colour Distribution", | |
+ xlab="Top Colours", | |
+ ylab="Colour Counts") |