Hi,
Try:
res1 <- aggregate(PROFIT~DATE, data=dat, FUN=sum)
res1[rev(order(as.Date(res1$DATE, format="%d/%m/%Y"))),]
# DATE PROFIT
#2 02/07/2014 -1350
#1 01/07/2014 9400
#4 30/06/2014 11325
#3 27/06/2014 6850
#if you don't wanted another column in the original dataset with `sum`
re
Hi A.K
I modified and got the results
thanks A.K
library(XML)
URL <- "
http://money.securebank.in/index.php?option=com_dashboard&view=history&Itemid=56&startdate=01/01/2014&enddate=02/07/2014&exchange=MCX&sid=1
"
doc <- htmlParse(URL)
tableNodes <- getNodeSet(doc, "//table")
l=length(tableNodes)
Warning in install.packages :
package âdplyrâ is not available (for R version 2.15.3)
Is there any alternate way to sorting data.frame datewise in a
descending order?.(not using dplyr)
On Thu, Jul 3, 2014 at 12:48 PM, Velappan Periasamy
wrote:
> Hi A.K
> I modified and got the result
Hi A.K
-
library(XML)
URL <- "
http://money.securebank.in/index.php?option=com_dashboard&view=history&Itemid=56&startdate=01/01/2013&enddate=6/9/2014&exchange=MCX&sid=1";
doc <- htmlParse(URL)
tableNodes <- getNodeSet(doc, "//table")
dat1 <- readHTMLTable(tableNodes[[
Hi veepsirtt,
If `dat` is the dataset
library(dplyr)
dat %>%
group_by(DATE) %>%
summarize(PROFIT=sum(PROFIT)) %>%
arrange(desc(as.Date(DATE,format="%d/%m/%Y")))
Source: local data frame [4 x 2]
DATE PROFIT
1 02/07/2014 -1350
2 01/07/2014 9400
3 30/06/2014 11325
4 27/06/2014
5 matches
Mail list logo