$ R
A <- c(1:10)
A
[1] 1 2 3 4 5 6 7 8 9 10
B <- c(61:70)
B
[1] 61 62 63 64 65 66 67 68 69 70
C <- cbind(A,B)
C
A B
[1,] 1 61
[2,] 2 62
[3,] 3 63
[4,] 4 64
[5,] 5 65
[6,] 6 66
[7,] 7 67
[8,] 8 68
[9,] 9 69
[10,] 10 70
D <- cbind("alpha"=A, "beta"=B)
D
alpha beta
[1,] 1 61
[2,] 2 62
[3,] 3 63
[4,] 4 64
[5,] 5 65
[6,] 6 66
[7,] 7 67
[8,] 8 68
[9,] 9 69
[10,] 10 70
colnames(C) <- cbind("alpha", "beta")
C
alpha beta
[1,] 1 61
[2,] 2 62
[3,] 3 63
[4,] 4 64
[5,] 5 65
[6,] 6 66
[7,] 7 67
[8,] 8 68
[9,] 9 69
[10,] 10 70
letters[1:10]
[1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
rownames(C) <- c(letters[1:10])
C
alpha beta
a 1 61
b 2 62
c 3 63
d 4 64
e 5 65
f 6 66
g 7 67
h 8 68
i 9 69
j 10 70
E <- c(551:560)
E
[1] 551 552 553 554 555 556 557 558 559 560
F <- cbind(C, E)
F
alpha beta E
a 1 61 551
b 2 62 552
c 3 63 553
d 4 64 554
e 5 65 555
f 6 66 556
g 7 67 557
h 8 68 558
i 9 69 559
j 10 70 560
colnames(F)
[1] "alpha" "beta" "E"
colnames(F)[3]
[1] "E"
colnames(F)[3] <- "delta"
F
alpha beta delta
a 1 61 551
b 2 62 552
c 3 63 553
d 4 64 554
e 5 65 555
f 6 66 556
g 7 67 557
h 8 68 558
i 9 69 559
j 10 70 560
F[,"alpha"]
a b c d e f g h i j
1 2 3 4 5 6 7 8 9 10
F[,1]
a b c d e f g h i j
1 2 3 4 5 6 7 8 9 10
median(F[,"alpha"])
[1] 5.5
F.norm <- F/c(median(F[,"alpha"]),median(F[,"beta"]),median(F[,"delta"]))
summary(F)
alpha beta delta
Min. : 1.00 Min. :61.00 Min. :551.0
1st Qu.: 3.25 1st Qu.:63.25 1st Qu.:553.2
Median : 5.50 Median :65.50 Median :555.5
Mean : 5.50 Mean :65.50 Mean :555.5
3rd Qu.: 7.75 3rd Qu.:67.75 3rd Qu.:557.8
Max. :10.00 Max. :70.00 Max. :560.0
summary(F.norm)
alpha beta delta
Min. :0.005401 Min. : 0.1116 Min. : 0.9919
1st Qu.:0.019785 1st Qu.: 0.3246 1st Qu.: 1.0041
Median :0.099237 Median : 1.0000 Median : 8.4656
Mean :0.426141 Mean : 4.0351 Mean : 33.2193
3rd Qu.:0.590909 3rd Qu.: 8.8581 3rd Qu.: 77.4063
Max. :1.818182 Max. :12.5455 Max. :101.4545
F.norm.raw <- F.norm/c(median(F[1,]),median(F[2,]),median(F[3,]),median(F[4,]),median(F[5,]),median(F[6,]),median(F[7,]),median(F[8,]),median(F[9,]),median(F[10,]))
summary(F.norm.raw)
alpha beta delta
Min. :8.572e-05 Min. :0.001800 Min. :0.01440
1st Qu.:2.992e-04 1st Qu.:0.005167 1st Qu.:0.01575
Median :1.485e-03 Median :0.015267 Median :0.12615
Mean :6.326e-03 Mean :0.061192 Mean :0.51107
3rd Qu.:9.268e-03 3rd Qu.:0.140180 3rd Qu.:1.15249
Max. :2.597e-02 Max. :0.181818 Max. :1.61877
png("110208_Rの練習.png")
par(mfrow = c(1,3))
boxplot(F, ylim = c(0,600), main = "raw")
boxplot(F.norm, ylim = c(0,600), main = "col.norm")
boxplot(F.norm.raw, ylim = c(0,600), main = "col.norm")
dev.off()