similar to: r: LOOPING

Displaying 20 results from an estimated 10000 matches similar to: "r: LOOPING"

2009 Mar 24
4
Error in FrF2 example on Mac OS
Dear all, I just noticed that the 0.9 update for FrF2 did not work out for Mac OS due to an error in an example that ran without error on all other platforms. I do not find any reason for this. In the past, umlauts or tab characters have sometimes been an issue, but I didn't find any of these. The function definition is FrF2(nruns = NULL, nfactors = NULL, factor.names = if
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)
2012 Oct 19
1
Looping survdiff
The number of recent questions from umn.edu makes me wonder if there's homework involved.... Simpler for your example is to use get and subset. dat <- structure(..... as found below var.to.test <- names(dat)[4:6] #variables of interest nvar <- length(var.to.test) chisq <- double(nvar) for (i in 1:nvar) { tfit <- survdiff(Surv(time, completion==2) ~
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
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
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
2007 May 18
1
partial correlation significance
Hi, among the many (5) methods that I found in the list to do partial correlation in the following two that I had a look I am getting different t-values. Does anyone have any clues on why is that? The source code is below. Thanks. pcor3 <- function (x, test = T, p = 0.05) { nvar <- ncol(x) ndata <- nrow(x) conc <- solve(cor(x)) resid.sd <- 1/sqrt(diag(conc)) pcc <-
2011 Feb 25
1
help please ..simple question regarding output the p-value inside a function and lm
Dear R community members and R experts I am stuck at a point and I tried with my colleagues and did not get it out. Sorry, I need your help. Here my data (just created to show the example): # generating a dataset just to show how my dataset look like, here I have x variables # x1 .........to X1000 plus ind and y ind <- c(1:100) y <- rnorm(100, 10,2) set.seed(201) P <-
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
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
2010 Feb 11
1
Code find exact distribution for runs test?
I've been attempting to understand the one-sample run test for randomness. I've found run.test{tseries} and run.test{lawstat}. Both use a large sample approximation for distribution of the total number of runs in a sample of n1 observations of one type and n2 observations of another type. I've been unable to find R code to generate the exact distribution and would like to see how
2013 Apr 01
2
Timing of SET_VECTOR_ELT
Assume a C program invoked by .Call, that returns a list. Near the top of the program we allocate space for all the list elements. (It is my habit to use "xyz2" for the name of the R object and "xyz" for the pointer to its contents.) PROTECT(means2 = allocVector(REALSXP, nvar)); means = REAL(means2); PROTECT(u2 = allocVector(REALSXP, nvar)); u =
2007 Oct 28
1
tree problem
I am trying to use tree to partition a data set. The data set has 3924 observations. Partitioning seems to work for small subsets of the data, but when I use the entire data set, no partitioning occurs. The variables are: RESP respondent to a survey (0 = not a respondent, 1 = respondent) AGE_P Age (continuous) ORIGIN_I Hispanic Ethnicity (1 = Hispanic, 2 = non-Hispanic) RACRECI2 Race
1999 Apr 27
2
Memory management
Dear all, I don't get it: First of all, the help doesn't say what are the memory limits of R. Say, what's the max heap size for instance ???? Secondly, I invoke R with the following commands each time: rgui --vsize 30M --nsize 1000K rgui --vsize 30M --nsize 2000K rgui --vsize 30M --nsize 3000K rgui --vsize 30M --nsize 4000K I try to open a matrix 8000x8000 by issuing
2010 Jan 19
2
Server hanging despite efforts to correct memory limits
My group is working with datasets between 100 Mb and 1 GB in size, using multiple log ins. From the documentation, it appears that vsize is limited to 2^30-1, which tends to prove too restrictive for our use. When we drop that restriction (set vsize = NA) we end up hanging the server, which requires a restart. Is there any way to increase the memory limits on R while keeping our jobs from
2017 Nov 22
2
function pointers?
We have a project that calls for the creation of a list of many distribution objects. Distributions can be of various types, with various parameters, but we ran into some problems. I started testing on a simple list of rnorm-based objects. I was a little surprised at the RAM storage requirements, here's an example: N <- 10000 closureList <- vector("list", N) nsize = sample(x
2013 Dec 08
2
How to evaluate sequence of strings like this
Hello Dear R community,  This is my problem.  I have a data set (dataframe) called "mydat". It consist of 3 numerical variable.  They are Centrecode, FSUSN and Round. I want to create unique ID by combining these 3 variables. Follwing commands gives me what I need. mydat1 <- paste(mydat$Centrecode, mydat$FSUSN,mydat$Round,sep="") newds <- data.frame(mydat1)    For a
2001 Aug 22
1
Huge workspace cannot be opened
Hi everyone, I have a problem that some people may have already encountered but i did not find the solution yet. As I use R to simulate several arrays of data, my workspace is now 35Mb big and I cannot launch R with it. An "xdr real data read error occured" and R tells me to delete .RData or increase memory. I WON'T delete this file and changing the max-nsize to 40600k did not
2000 Nov 09
3
maximum of nsize=20000k ??
Dear R-ers, somehow it is not possible to increase nsize to more than 20000k. When I specify e.g. > R --vsize=10M --nsize=21000K the result is: free total (Mb) Ncells 99658 350000 6.7 Vcells 1219173 1310720 10.0 Maybe I have overlooked s.th.... Marcus -- +------------------------------------------------------- | Marcus Eger | E-Mail: eger.m at gmx.de (NEW) |
2000 Dec 01
1
bug in outer() (PR#755)
Full_Name: Matthias von Davier Version: 1.1.1 OS: nt4.0 Submission from: (NULL) (144.81.31.148) sim3pl <- function(theta,i) { p2 <- p3pl(theta,i) p1 <- runif(1) temp <- response(p1,p2) return(p1) } when calling outer(theta,items,sim3pl), where theta = rnorm(100,m,s) and items = seq(1:nvar) runif(1) is only called once (instead of 100*nvar times), even though if calling sim3pl