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") | |
entries <- data.frame(label=factor(c("小説", "読書", "漫画", "新書"), | |
levels=c("小説", "読書", "漫画", "新書")), | |
num=c(64, 48, 44, 2)) | |
g <- ggplot(entries, aes(x=label, y=num, fill=label)) | |
p <- g + geom_bar() | |
p <- p + xlab("ラベル") + ylab("投稿数") + ggtitle("2013年に読んだ本") + theme(legend.position = "none") |
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
/** | |
* Make a line chart with the data exported from iOS App SimppleDiet to Google Docs Spreadsheet. | |
*/ | |
function addLineGraph() { | |
var sheets = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = sheets.getSheets()[0]; | |
var allRange = sheet.getDataRange(); | |
var range = sheet.getRange(1, 1, allRange.getLastRow(), 2); | |
var chart = sheet.newChart().asLineChart() |
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
// コンストラクタを構成するモジュール | |
MYAPP.namespace('MYAPP.utilities.Array'); | |
// 使い方 | |
// var arr = new MYAPP.utilities.Array(obj); | |
MYAPP.utilities.Array = (function () { | |
// 依存関係 | |
var upbj = MYAPP.utilities.object, | |
ulang = MYAPP.utilities.lang, | |
// プライベートのプロパティとメソッド |
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 of ajax | |
TestCase('AjaxExample', { | |
'test makes a GET request for todo items':sinon.test(function(stub) { | |
this.stub($, 'ajax'); | |
getTodos(42, sinon.spy()); | |
assertTrue($.ajax.calledWithMatch({url: '/todo/42/items'})); | |
}) | |
}); |
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") | |
p# acquire | |
# 下記形式のinterval.csvから日付を取得 | |
# "number","start","end" | |
# "1","2013-1-1","2013-1-31" | |
interval <- read.csv(file="interval.csv", as.is=TRUE) | |
# parse | |
interval$start <- as.Date(interval$start) |
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") | |
entries <- data.frame(label=factor(c("小説", "読書", "漫画", "新書"), | |
levels=c("小説", "読書", "漫画", "新書")), | |
num=c(69, 34, 17, 3)) | |
g <- ggplot(entries, aes(x=label, y=num, fill=label)) | |
p <- g + geom_bar() | |
p <- p + xlab("ラベル") + ylab("投稿数") + ggtitle("2012年に読んだ本") + theme(legend.position = "none") |
NewerOlder