This could be a trivial query but I am very new to R. I have data in two columns (Col X and ColY). Column X has ONLY positive values while Column Y has both positive and negative values. I would like to plot X vs Y, but with certain given ranges of negative and positive values of Y, in different colors. For example my data is like:
I would like to plot value of negative subset of Y ranging from (< 0 to -4) in one color (say red) and the subset positive values of Y ranging between (>0 to 4) in green. And rest of the values in Grey.
I would really appreciate help in defining conditional subset in R and plotting them in different colors.