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
library(ggplot2) | |
require(ggplot2) | |
# also require ggplot_lm.R on https://gist.github.com/shenqi/29b42a6be83ec9e0517d | |
ggplot0 <- function(x, y, data, label, shape, ...){ | |
return(ggplot(data, aes_string(x = x, y = y, label = label, shape = shape, ...))) | |
} | |
draw_ggplot <- function(x, y, data, point.size, label, label.hjust, shape, shape.solid, lm_formula, r2.adjusted, r2.pos_x, r2.pos_y, r2.digits, r2.color, legend.position, ...) { | |
g0 <- ggplot0(x, y, data, label, shape, ...) + geom_point(size = I(point.size)) + theme_classic() |
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
library(gtable) | |
require(gtable) | |
library(foreach) | |
require(foreach) | |
unit.def <- 'inches' | |
plot.length.def <- 6 | |
legend.length.def <- 1.5 | |
as.unit <- function(n){return(unit(n, unit.def))} |
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
library(stringr) | |
# 出入金レコード | |
b <- read.csv('bank statement.csv', fileEncoding='cp932') | |
b$date <- paste0(b$取扱日付.年,'/',b$取扱日付.月,'/',b$取扱日付.日) | |
b$amount <- ifelse(b$取引名 == '入金', b$金額, -b$金額) | |
b$detail <- ifelse(str_detect(b$摘要, 'VISA'), str_sub(b$摘要, 11, 16), as.character(b$摘要)) | |
b$payee <- ifelse(str_detect(b$摘要, 'VISA'), '', as.character(b$摘要)) | |
# b[,22:25] |
OlderNewer