Displaying 20 results from an estimated 700 matches similar to: "Timing of SET_VECTOR_ELT"
2011 Jan 17
1
isoreg memory leak?
I believe there is a memory leak in isoreg in the current version of R,
as I believe the following shows
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 120405 3.3 350000 9.4 350000 9.4
Vcells 78639 0.6 786432 6.0 392463 3.0
> for(k in 1:100) {
+
+ y <- runif(10000)
+ isoreg(x,y)
+ }
> rm(x)
> rm(y)
> gc()
used (Mb) gc
2001 Sep 10
1
not safe to return vector pointer
Hello All,
I recently upgraded from R-1.1.1 to R-1.2.2.
I have an R function that uses .Call() to
return a list from C code. The C code
has the form:
SEXP function(SEXP var)
{
SEXP rlist ;
PROTECT(rlist = NEW_LIST(3)) ;
VECTOR_PTR(rlist)[0] = NEW_INTEGER(1) ;
VECTOR_PTR(rlist)[1] = NEW_STRING(1) ;
...
UNPROTECT(1) ;
return(rlist) ;
}
When I try to
2006 Feb 01
1
several plots in one
Can anyone tell me how I can supply more than one graph to plotCI
(gplots) at once?
Below is what I tried, also with rbind instead of cbind.
What is the way to do this (in general, I think)?
Problem is that lines of 1-st and 2-nd series are mixed, while they have
nothing to do with each other.
I also tried calling plotCI with argument add=TRUE, which didn't seem to
work (that is actually
2008 Dec 16
1
renaming factor-labels / add factors etc.
Hi,
how can I change a defined factor-variable?
Like adding levels, renaming existing levels or merge several levels
of a factor to one level?
For example; following factor-variable is given:
x <- factor(c("xyz1", "abc1", "xyz2", "abc2"))
How can I add the level fgh?
And how can I merge "xyz1" and "xyz2" to one level?
And
2012 Aug 08
2
RQuantLib: SET_VECTOR_ELT() can only be applied to a 'list', not a 'symbol'
# Hi all,
# trying to run the following example code
# from 'RQuantLib' package...
HullWhite <- list(term = 0.055, alpha = 0.03, sigma = 0.01,
gridIntervals = 40)
Price <- rep(as.double(100),24)
Type <- rep(as.character("C"), 24)
Date <- seq(as.Date("2006-09-15"), by = '3 months', length = 24)
callSch <- data.frame(Price, Type,
2012 Oct 29
0
why isn't integrate function working in a likelihood
Dear R users,
I have been trying to solve for mle's of a function that involves an
integral and I keep getting an error. I created an example to work on first
and even the simple example doesn't give me the mle's. I am getting the
error "Error in integrate(integrand, 0, Inf) : non-finite function value".
I divided my likelihood function into two parts, one part involves
2006 Feb 15
1
Multiple comparison for circular data
Hi All,
Does anyone know how to compare the means of several circular-data
samplings? Any related websites, references and softwares?
Thanks
Xiaohua
--
Xiaohua Dai, Dr.
[[alternative HTML version deleted]]
2010 Jan 22
1
confidence intervals for mean (GLM)
Dear useRs,
How could I obtain the confidence intervals for the means of my treatments, when my data was fitted to a GLM?
I need the CI's for the Poisson and Negative Binomial distributions.
Here's what I have:
mydata1 <- data.frame('treatments'=gl(4,20), 'value'=rpois(80, 1))
model1 <- glm(value ~ treatments, data=mydata1, family=poisson)
means1 <-
2008 Mar 31
2
L-BFGS-B needs finite values of 'fn'
Dear All,
I am trying to solve the optimization problem below, but I am always
getting the following error:
Error in optim(rep(20, nvar), f, gr, method = "L-BFGS-B", lower = rep(0, :
L-BFGS-B needs finite values of 'fn'
Any ideas?
Thanks in advance,
Paul
-----------------------------------------------
k <- 10000
b <- 0.3
f <- function(x) {
n <- length(x)
2017 Oct 27
4
Cannot Compute Box's M (Three Days Trying...)
It can't be this hard, right? I really need a shove in the right direction here. Been spinning wheels for three days. Cannot get past the errors.
I'm doing something wrong, obviously, since I can easily compute the Box's M right there in RStudio
But I don't see what is wrong below with the coding equivalent.
The entire code snippet is below. The code fails below on the call to
2011 Jul 19
1
"may be used in an incorrect context"
R CMD check tells me
* checking R code for possible problems ... NOTE
agexact.fit.rds: ... may be used in an incorrect context: ?optim(init,
agfitfn, ...)?
Warning: <anonymous>: ... may be used in an incorrect context: ?optim(init, agfitfn, ...)?
Can anyone tell me what this message means? My searches haven't turned
up anything useful. This is with R 2.7 and 2.9.
The message
2012 Feb 07
2
predict.naiveBayes() bug in e1071 package
Hi,
I'm currently using the R package e1071 to train naive bayes
classifiers and came across a bug: When the posterior probabilities of
all classes are small, the result from the predict.naiveBayes function
become NaNs. This is an issue with the treatment of the
log-transformed probabilities inside the predict.naiveBayes function.
Here is an example to demonstrate the problem (you might need
2018 Oct 02
3
maximum matrix size
I am now getting the occasional complaint about survival routines that are not able to
handle big data.?? I looked in the manuals to try and update my understanding of max
vector size, max matrix, max data set, etc; but it is either not there or I missed it (the
latter more likely).?? Is it still .Machine$integer.max for everything??? Will that
change??? Found where?
I am going to need to go
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
Hey Duncan,
Hard to debug? That's an understatement. Eyes bleeding....
In any case, I tried all your suggestions. To get "integer" for the final column, I had to change the code to get integers instead of strings.
double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles();
double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles();
double[] d3 = ((REXPVector)
2010 May 25
1
General Question regarding Lists
Hello,
Here is a general question that I think many of you will have insight to.
I have 40 independent dataframes. Each has a dimension of 1359 x 15. For
example
>dim(meanAnnualWaterDepth)
> 1539 15
I need to calculate the average value for each dataframe but only for
columns 7: 15. I can do this with apply as follows:
meanAnnualWaterDepth$Average <-
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
Thanks Duncan. Awesome ideas!
I think we're getting closer!
I tried what you suggested and got a possibly better error...
.
.
.
rConnection.assign("boxMVariable", myDf);
String resultBV = "str(boxMVariable)"; // your suggestion.
RESULTING ERROR:
Error in format.default(nam.ob, width = max(ncn), justify = "left") : invalid 'width' argument
(No idea
2008 Jan 14
2
Permutations of variables in a dataframe
Hallo All,
I would like to apply a function to all permutations of variables in a
dataframe (except the first). What is the best way to achieve this?
I produce the permutations using:
nvar <- ncol(dat) - 1
perms <- as.matrix( expand.grid(rep( list(1:0) , nvar ))[ , nvar:1] )
Thanks in advance
Serguei
Test-dataframe, comma-delimited:
code,wav,w,area,gdp,def,pop,coast,milspend,agr
2013 Apr 25
1
lsfit: Error in formatting error message
Hi,
in R-3.0 I get the following error when calling lsfit with more
observations than variables, which seems to come from an error in the
formatting of the error message (note that this was not happening in
2.15.3):
> nobs <- 5; nvar <- 6; lsfit(matrix(runif(nobs*nvar), ncol=nvar),
runif(nobs), intercept=FALSE)
Error in sprintf(ngettext(nry, "%d response", "%d
2008 Nov 30
1
Rserve and creating a list of lists
Hello,
I have some code which generates lattice objects. The function
recieves serialized forms of the lattice objects which it then
unserializes and then adds to an ArrayList<REXP>.
REXPRaw rser = new REXPRaw( target ); //target contains the raw
serialized forms of lattice objects
rconn.assign("temp",rser);
REXP ret =
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
I'm not sure what you mean. Could you please be more specific?
If I print the string, I get: boxM(boxMVariable[, -5], boxMVariable[, 5])
From this code:
.
.
.
// assign the data to a variable.rConnection.assign("boxMVariable", myDf);
// create a string command with that variable name.String boxVariable = "boxM(boxMVariable[, -5], boxMVariable[, 5])";