presentation | ||||||||
---|---|---|---|---|---|---|---|---|
|
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
--use | |
--http://sqlfiddle.com/ | |
--table | |
create table address( | |
name varchar(100), pref varchar(100),age int | |
); | |
insert into address(name,pref,age) values('野口','埼玉',30); | |
insert into address(name,pref,age) values('深谷','東京',20); |
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
[SQL Fiddle][1] | |
**MS SQL Server 2017 Schema Setup**: | |
create table t1( | |
id int not null primary key | |
,name varchar(100) not null | |
,dept varchar(100) null | |
,age int | |
); |
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
org_list <- c('g1','g2','g3','g4','g5','g6','g7','g8','g9') | |
org_list <- as.factor(org_list) | |
org <- sample(org_list, 1000, T) | |
a <- sample(0:10,1000,T) | |
b <- sample(0:10,1000,T) | |
c <- sample(0:10,1000,T) | |
d <- sample(0:10,1000,T) | |
k <- sample(0:3,1000,T) | |
df <- data.frame(org,a,b,c,d,k) | |
summary(df[2:6]) |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 4 columns, instead of 3. in line 1.
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
ビール, おむつ, ドレッシング, 生野菜 | |
ビール, 柿ピー, ソーセージ | |
ソーダ, ポテトチップス, チョコレート, アイス | |
ビール, 柿ピー, ソーセージ | |
生野菜, 果物, 豆腐, 豚肉 | |
生野菜, 果物, 豆腐, 牛肉, じゃがいも | |
根菜, 豆腐, 牛肉, こんにゃく | |
ワイン, ソーセージ, チーズ | |
ワイン, 牛肉, じゃがいも | |
柿ピー, ビール |
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
1 | ビール | |
---|---|---|
1 | おむつ | |
1 | ドレッシング | |
1 | 生野菜 | |
2 | ビール | |
2 | 柿ピー | |
2 | ソーセージ | |
3 | ソーダ | |
3 | ポテトチップス | |
3 | チョコレート |
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
# load library #### | |
library(dplyr) | |
library(readr) | |
rm(list=ls()) | |
# single形式のCSVファイルを読み込む | |
mytemp <- read_csv(file="dat/dat_single.v2.csv" | |
,col_types = c("cc") | |
,col_names = c("tranID","item") | |
,quote = '\"' |
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
# load library #### | |
library(dplyr) | |
library(tidyr) | |
library(maptools) | |
# make data #### | |
dd <- data.frame( | |
dept=rep(c('d1','d2','d3','d4','d5'),each=10) | |
,ym=rep(seq(201808,201812,1),10) |
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
# データの引用:https://www.nikkei.com/article/DGXLMSJJ40701_T11C19A1000000/ | |
$honbun = @' | |
▽ (2020年1月1日)執行役員副社長総務部・人事室・ペット事業室担当(専務執行役員)竹内明▽ベビー事業本部副本部長兼プレママプロジェクト・こども未来研究所・RDJP担当、執行役員ベビー営業兼マーケティング室長小堀英次▽総務(内部監査室長兼ファミリー・サポート監査役)野水宏江▽ロジスティクスセンター長(総務室長)池田浩孝▽内部監査室長兼ファミリー・サポート監査役(ロジスティクスセンター長)梨本博之 | |
'@ | |
$midashi = "人事、コンビ" | |
$honbun = $honbun.Replace(" (","(").trim().Replace("`r`n","") | |
$midashi = $midashi.Replace("人事、","") | |
$record = $honbun.Remove(0,1).Insert(0,"$midashi,").Replace("▽", "`r`n$midashi,") |
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
# 比較用CSVをインポートする | |
$test1 = Import-Csv -Path test1.csv -Encoding Default | |
$test2 = Import-Csv -Path test2.csv -Encoding Default | |
# 比較用項目を指定する | |
$test1_name = $test1 | %{ $_.name } | |
$test2_name = $test2 | %{ $_.name } | |
function Get-MyDiffKey { |
OlderNewer