Here is what I am doing, after creating the design matrix, I am trying to create the contrast matrix
# > sample <- factor(rep(c("Non neoplastic","Tumor"), each=21))
> design.mat <- model.matrix(~0+sample)
> colnames(design.mat) <- levels(sample)
> design.mat
Non neoplastic Tumor
1 1 0
2 1 0
3 1 0
4 1 0
5 1 0
6 1 0
7 1 0
8 1 0
9 1 0
10 1 0
11 1 0
12 1 0
13 1 0
14 1 0
15 1 0
16 1 0
17 1 0
18 1 0
19 1 0
20 1 0
21 1 0
22 0 1
23 0 1
24 0 1
25 0 1
26 0 1
27 0 1
28 0 1
29 0 1
30 0 1
31 0 1
32 0 1
33 0 1
34 0 1
35 0 1
36 0 1
37 0 1
38 0 1
39 0 1
40 0 1
41 0 1
42 0 1
attr(,"assign")
[1] 1 1
attr(,"contrasts")
attr(,"contrasts")$sample
[1] "contr.treatment"
> contrast.mat <- makeContrasts(diff = "Non neoplastic-Tumor", levels = design.mat)
#Error in makeContrasts(diff = "Non neoplastic - Tumor", levels = design.mat) :
The levels must by syntactically valid names in R
thank you so much