Passing contrasts as a vector gives an error
1
0
Entering edit mode
@agaz-hussain-wani-7620
Last seen 6.1 years ago
India

I have some issue while passing contrast argument as a vector. I create a vector

contrasts <- c("TT-C,D-C,DT-C,D-TT,DT-TT,DT-D")

after removing double quotes from the above vector by

noquote(contrasts)

I pass it to

contrast.matrix <- makeContrasts(contrasts,levels=design)

to construct a contrast matrix, which gives an error:

Error in cm[, j] <- ej :
  number of items to replace is not a multiple of replacement length

If i use

contrast.matrix <- makeContrasts(TT-C,D-C,DT-C,D-TT,DT-TT,DT-D,levels=design)

it works nicely. May i know what is going wrong. Thanks

r limma differential expression • 1.6k views
ADD COMMENT
1
Entering edit mode
@gordon-smyth
Last seen 1 hour ago
WEHI, Melbourne, Australia

Look at ?makeContrasts and read the code example. The last two lines show you exactly how to do what you want.

ADD COMMENT
0
Entering edit mode

Thanks , was not aware of the strength of "=" :)

ADD REPLY

Login before adding your answer.

Traffic: 884 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6