dimanche 24 avril 2016

Filter by one field and multiply by negatives in R

I have to filter the return volumes using the relevant code and make the relevant volumes negative in a data set. How should the R could be?

I used the following code which did not work. ifelse(sales$TRANSACTION.TYPE=="RE",-1 * sales$Shipped.Quantity, 1**sales$Shipped.Quantity)

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire