Raw <- read.table("it.feb.txt", header=TRUE, row.names=1) ind <- which((Raw==Raw["all",1]) | ## find row with "all" (Raw==Raw["total",1])) ## or "total" Dat <- Raw[-ind,,drop=FALSE] ## new data.frame without that row Dat <- Dat[order(-Dat[,1]),1,drop=FALSE]## (re-)order by downloads, desc. Dat <- rbind(Dat, total=sum(Dat[,1])) ## add a new row for totals Dat <- cbind(Dat, ## add a percentage column percent=round(100*Dat[,1]/Dat["total",1], 4)) Dat <- cbind(Dat, ## and one for cumulative percentages cumulpct=round(cumsum(Dat[,1]/Dat["total",1]*100), 4)) Dat["total","cumulpct"] <- NA print(Dat) ## show result