[R] Groupwise sum

2014-05-21 Thread Anna Carter
Dear R forum, I have following data.frame - my_dat = data.frame(sr = c(0,0,0,0, 1, 1, 1, 1, 2, 2, 2, 2), bond = c("A", "B", "B", "B", "A", "B", "B", "B", "A", "B", "B", "B"), cashflow = c(1000, 2000, 2000, 4000, 10, 200, 300, 100, 80, 40, 60, 120)) > my_dat    sr   bond  cashflow 1   0    A  

[R] Deleting colmuns with 0's and also writing multple csv files

2010-02-18 Thread Anna Carter
Dear R helpers,   I have two queries.   (1) If the dataset contains some variables having all the entries = 0 and while analysing I want to delete those pericular columns, how do acheive this. i.e.   dataset1   sr_no    var1  var2   var3    var4    var5 1   5   0   

[R] Rearranging data

2010-02-18 Thread Anna Carter
   corp17 17-Feb   65    95 30  16 16-Feb   70   135 15-Feb   69   140 14-Feb   89 13-Feb   88 #(The above figures represent the corp-wise and date-wise rates for investment_id = 1.) Please guide me how the filtered1 can be rearranged?