search for: total_sum

Displaying 2 results from an estimated 2 matches for "total_sum".

Did you mean: total_sums
2007 Dec 31
0
Optimize jackknife code
...would optimize this. I think that the for (i in 1:N_B) part is bad because Rprof() said sum() is called very often but I have no idea how to optimize it. #O <- read.table("foo.dat")$V1 O <- runif(100000); k=100 # size of block to delete # the jacknife block has size N-k total_sum=sum(O); for (k in 1:2) { N_B = length(O) %/% k; N = N_B*k; # truncate data size to multiple of k # data beyond O[N] is not used #total_sum = sum(O[1:N]) # truncate data size N (which is a multiple of k) delete_block_sums = rep(0, N_B); for (i in 1:N_B) {...
2009 May 06
2
X and Y axis labels on a barplot
Dear all, I have produced a barplot and wish to alter the axes a little. In place of the variable names appearing on the x-axis, I'd like to have the numbers 1986 to 1995. I have tried using the argument xlim=c(1986,1995) in the barplot command but receive: "Error in plot.window(xlim, ylim, log = log, ...) : invalid 'xlim' value" Also, on the y-axis, the values are