Hi

I'm using this :)

if (is.element('DESeq', installed.packages()[,1]) == FALSE) {
install.packages('DESeq') }

Robin

2011/9/27 Fabrice Tourre <fabrice.c...@gmail.com>

> Dear list,
>
> How can I detect a package is installed or not? If not, then install it.
>
> For example, in a script, I want to check the package DESeq is
> installed or not. If not, then I will using this script to install it.
>
> source("http://www.bioconductor.org/biocLite.R";)
> biocLite("DESeq")
>
> The pseudo script would be like this:
>
> try:
>    library("DESeq")
> catch:
>    source("http://www.bioconductor.org/biocLite.R";)
>    biocLite("DESeq")
>
> Thank you
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to