Hi all, I have just a very simple question about subsetting data.

I have a data frame with many columns, two columns are indicating the fold change after RNA-seq data analysis.
This two columns contain positive and negative values. I would like to keep the opposite values (negative in one column and positive in the other and vice versa) while removing those which are the same sign (negative and negative in the two columns or positive and positive).

Example:

    df$1   df$2
     1.      2
    -1.      1 
    -1.      4
     3.     -2
     6.     -4
    -6.     -6
     6.      1
    -3.      7
    ......
    
     Resulting dataframe :
    
    df$1.  df$2
    
    -1.     1
    -1.     4
     3.    -2
     6.    -4
    -3.     7
    ......

Any help, highly appreciated, thanks!
You can define a new column:

    df$3 = df$1 * df$2

then

    df <- subset(df, df$3 < 0, select = 1:2)