Thiago [guest] | 26 Feb 12:46 2013

Simple question about Vector


   I'm new at bioconductor and I have a very simple and stupid question, but I couldn undertand how to do that.

I have a vector with a column with negative numbers(double). I want to change all negative to positive.
I then made a function:
    if(number < 0){
        number <- number * -1
then I run
> bed[12] <- arruma(bed[,11])

I got this error

Warning message:
In if (number < 0) { :
  the condition has length > 1 and only the first element will be used

What happen is that all negative became positive and all positive became negative.

Does enybody know what I'm doing wrong?

thanks and best regards

 -- output of sessionInfo(): 

> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)

[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_2.15.2

Sent via the guest posting facility at

Bioconductor mailing list
Search the archives: