Displaying 1 result from an estimated 1 matches for "tradesnew".
Did you mean:
tradenet
2010 May 27
1
switch function
...3L), class = "data.frame")
I want to replace "Buy" by "Sell" and "Sell" by "Buy" in column
"Buy.Sell..Cleared." when element in column "Trade.Status" is equal to
"DEL".
I think I can write something like this :
>tradesnew<-sapply(trades$Buy.Sell..Cleared[which(trades$Buy.Sell..Cleared==
"DEL"),],switch,.......) but I don't really know how to pass further
arguments to the switch function.
Any help is appreciated.