CHAPTER 1. BRIEF INTRODUCTION INTO USING R
Now we have created the object gene1 containing three gene expression values. To compute the sum, mean, and standard deviation of the gene expression values we use the corresponding built-in-functions. > sum(gene1) [1] 3.75 > mean(gene1) [1] 1.25 > sum(gene1)/3 [1] 1.25 > sd(gene1) [1] 0.25 > sqrt(sum((gene1-mean(gene1))^2)/2) [1] 0.25 By defining x1 = 1.00, x2 = 1.50, and x3 = 1.25, the sum of the weights can be expressed asPn i=1 xi = 3.75. The mathematical summation symbolPisin R language simply sum. The mean is denoted by x =P3 i=1 xi/3 = 1.25 and the sample standard deviation as s =v u u t 3 X i=1 (xi −x)2/(3−1) = 0.25.