similar to: Conditional expand.grid()

Displaying 20 results from an estimated 7000 matches similar to: "Conditional expand.grid()"

2008 Nov 23
2
How is R working in multicore and multiprocessor environment?
My Dear R buddies, I'm feeling ashamed that I've been running my R program on some servers for a while but do not know exactly how R is working. The servers are chained together using Sun Grid Engine. Each node has 8 quad-core CPUs. I wonder how many cores and CPUs are used by a simple single-thread R program. Thanks a lot. Best wishes, -- ??? Hesen Peng
2008 Nov 29
2
Reading mixed tables
Dear R buddies, This weekend I became interested in solving Google Code Jam problems using R. I guess R may work very well in this kind of contests but the input of file has been a problem for me. Take this case for example (http://code.google.com/codejam/contest/dashboard?c=agdjb2RlamFtchALEghjb250ZXN0cxjRzBQM), the files are usually of the form: A(number of lines for group 1) a11 a12 a13 a21
2008 Sep 11
1
Convex optimization in R?
Hi my R buddies, I'm trying to solve a specific group of convex optimization in R. The admissible region is the inside and surface of a multi-dimensional eclipse area and the goal function is the sum of absolution values of the variables. Could any one please tell me whether there's a package in R to do this? Thank you very much, Best wishes, -- ??? Hesen Peng
2008 Nov 24
2
More than doubling performance with snow
Hey my R buddies, I installed the "snow" and "rpvm" package on my Lenovo Thinkpad T400 today. The experiment below gave me a surprise. The time consumed by serial processing was several times larger than that taken by parallel processing. I'm very curious how this happened. Thank you very much. > library(snow) > > cc <- makePVMcluster(2) > > temp <-
2008 Oct 03
1
When to set small values to 0?
My dear R buddies, I've run into a problem when doing numerical computation recently. In a program that I've been working on, I usually get a vector of real values which are theoretically (and it's correct) supposed to decrease until reaching zero after a given value. However, most of the value just wander at 10^-8 scale and never shrink exactly to zero. So I guess I should manually
2008 Aug 12
2
Multiple column/row names?
Hi all, I wonder if there is a way to create a matrix with two (or even more) column/row names? Thank you very much. Have a nice day. -- ??? Hesen Peng http://hesen.peng.googlepages.com/
2008 May 18
2
*apply function for arrays?
Hi all, I've recently been writing functions which may deal with very large arrays. And I hope to use *apply functions in the program so that the code may look nicer and the performance may be better in the following two situations. The first situation is: I'm having an array A with dim(A)==c(m,n,p). And I want to apply a function F to a group of elements in A like: 1) F is applied to
2009 Oct 27
1
How to express a tree?
Hello everybody, I'm write a function whose output represents a tree. Can anyone please recommend me some data structure in R which are good for expressing a tree? The possible idea I'm having in my mind is to represent the whole tree as a list in which a sublist (an element to the main list) contains all its corresponding branches. Is there any simpler way of doing this? Thank you very
2008 Oct 08
5
ParallelR
Anyone using or has access to ParallelR? I was looking at the page and found nothing really useful! http://www.revolution-computing.com/sitegenius/topic.php?id=195 I want to see if I can run R on a cluster of workstation, and use batch systems like Grid Engine or Xgrid: http://gridengine.sunsource.net/ http://ww.apple.com/acg/xgrid/ --Chi
2009 Aug 06
5
Is there a 'vi' mode in R?
Hi, I'm wondering if R provide a vi mode in the command line just like other shells such as bash do. Can somebody let me know? Regards, Peng
2009 Jun 16
1
Constrained Optimization, a full example
After a few days of work, I think I nearly have it. Unfortunately, theta is unchanged after I run this (as a script from a file). I thought that theta would contain the fitted parameters. The goal here is to find the least squares fit according to the function defined as "rss" subject to the constraints defined as ui and ci. I defined ui and ci to (hopefully) force par2 and par3
2007 Nov 16
2
expand.grid overflows?
>cbn<-as.matrix(expand.grid( rep( list(0:1), 50))) Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : invalid 'times' value In addition: Warning message: In rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : NAs introduced by coercion But I'm only interested in cbn matrix rows where: cbn<- cbn[rowSums(cbn)==5,] Is there a way to evaluate it
2013 Mar 25
2
Faster way of summing values up based on expand.grid
Hello! # I have 3 vectors of values: values1<-rnorm(10) values2<-rnorm(10) values3<-rnorm(10) # In real life, all 3 vectors have a length of 25 # I create all possible combinations of 4 based on 10 elements: mycombos<-expand.grid(1:10,1:10,1:10,1:10) dim(mycombos) # Removing rows that contain pairs of identical values in any 2 of these columns: mycombos<-mycombos[!(mycombos$Var1
2008 Jul 03
1
Problem in applying conditional looping
Respected All, I hope you are enjoying good health, I am tring to write a program in R but could not be very sucessful. My program draws random sample form bivariate normal distribution and then compute a variable PIJ. For certian samples some entries of variable PIJ is apearing as negative, which result in negative variance estimator. I want to introduce a loop in my program that verify the each
2008 Jan 18
1
Fortran level mismatch between package and R
We have a user here who is attempting to compile a package which requires f90 (gfortran will do). Our version of R was built with f77 (g77). When the user attempts to build the package, f77 is always invoked and fails due to the presence of f90 features. Is there a simple method or some documentation on how to force a package build to use a different compiler than the one used in
2008 Jan 31
3
fastest way to compute the squared Euclidean distance between two vectors in R
I have a program which needs to compute squared Euclidean distance between two vectors million of times, which the Rprof shows is the bottleneck. I wondered if there is any faster way than my own simple function distance2 = function(x1, x2) { temp = x1-x2 sum(temp*temp) } I have searched the R-help archives and can not find anything except when the arguments are matrices. Thanks for any
2009 Feb 25
2
run latent class analysis with R
What's the best approach to running latent class analysis with R? I've downloaded both randomLCA and poLCA packages, but I am interesting in running a standard LCA with individual records (not frequency table) as input data. Wen Gu John Jay College of Criminal Justice445 West 59 StreetNew York, NY 10029 wgu@gc.cuny.edu _________________________________________________________________
2010 Mar 26
2
More efficient alternative to combn()?
Hi, i am working on a problem where i need to compute the products of all possible combinations of size m of the elements of a vector. I know that this can be achieved using the function combn(), e.g.: > vector <- 1:6 > combn(x = vector, m = 3, FUN = function(y) prod(y)) In my case the vector has 2000 elements and i need to compute the values specified above for m = 32. Using combn() i
2010 Aug 31
2
R and Epi Info
Hello, I was wondering who to contact to see about somehow interconnecting or integrating the programs R and Epi Info. I have been involved in the development of Epi Info which is a software program developed by the Centers for Disease Control and Prevention (CDC) in Atlanta (www.cdc.gov/epiinfo<http://www.cdc.gov/epiinfo>). Epi Info allows for creating data entry systems and performs
2007 Apr 10
1
R CMD Rdconv drops sections: arguments, seealso, examples (PR#9606)
I've created a .Rd file (below), then converted that to .sgml using R CMD Rdconv --type=Ssgm combn.Rd > combn.sgml The output (shown below) is missing some of the sections: arguments seealso examples If instead I convert to .d (below), the same sections are missing, and the "note" section is included but without the necessary newline.