Hi,
I have a design matrix that looks like this
fit <- lmFit(expressionData_2, design = design)
fit <- eBayes(fit)
Then, I want comparing each subtype to all the other subtypes using MakeContracts
function. I wrote this code:
` contrast_matrix <- makeContrasts(
`"MS1avsOther" = MS1a - (MS1b + MS2a_1 + MS2a_2 + MS2b_1 + MS2b2_1 + MS2b2_2) / 6,`
`"MS1bvsOther" = MS1b - (MS1a + MS2a_1 + MS2a_2 + MS2b_1 + MS2b2_1 + MS2b2_2) / 6,`
`"MS2a_1vsOther" = MS2a_1 - (MS1b + MS1b + MS2a_2 + MS2b_1 + MS2b2_1 + MS2b2_2) / 6,`
`"MS2a_2vsOther" = MS2a_2 - (MS1b + MS2a_1 + MS2a_1 + MS2b_1 + MS2b2_1 + MS2b2_2) / 6,`
`"MS2b_1vsOther" = MS2b_1 - (MS1b + MS2a_1 + MS2a_2 + MS2b_1 + MS2b2_1 + MS2b2_2) / 6,`
`"MS2b2_1vsOther" = MS2b2_1 - (MS1b + MS2a_1 + MS2a_2 + MS2b_1 + MS2b_1 + MS2b2_2) / 6,`
`"MS2b2_2vsOther" = MS2b2_2 - (MS1b + MS2a_1 + MS2a_2 + MS2b_1 + MS2b2_1 + MS1a) / 6,`
'levels = design`
)
i got this error: The levels must by syntactically valid names in R, see help(make.names). Non-valid names: MS1a, MS1b, MS2a_1, MS2a_2, MS2b_1, MS2b2_1, MS2b2_2
I read the make.name
documentation and from what I understood, my naming is correct. initially, the MS2b_1
, MS2b_2
were MS2b.1, MS2b.2
I was not expecting to see same error after renaming.
Please, I need assistance on this.
Regards,
Could you share
dput(design)
instead of a picture ?Basti , I could not send the output of
dput(design)
. I clicked ofsave
button but it did not deliver. I think the its because the output is too longdput(design[1:6,1:7])
should do the trickBasti ,
Thank you for your response.
This is the output:
Basti ,
Thank you for the observation. After remove the space, its works perfectly :)