similar to: Creating different matrices in a loop

Displaying 20 results from an estimated 200 matches similar to: "Creating different matrices in a loop"

2011 Jun 26
2
Ordering a matrix based on cluster no
Hi All I have a symmetric matrix of genes ( 100x100 matrix). I also have a matrix (100x2) of two columns where column 1 has the gene names and column 2 has the cluster it belongs to (they are sorted and grouped based on the cluster no). I would like to order the rows and columns of the 100x 100 matrix such that the first n genes correspond to cluster 1 and next n genes correspond to cluster 2
2011 Nov 21
1
Sub sets
I'd appreciate it if you'd keep on list for the archives. That said, I think this function does what you were hoping for. Michael powerset <- function(n, items = NULL){ if(!is.null(items)) { if(n != length(items)) warning("Resetting n in preference to length(items)") n = length(items) } smat <- do.call(expand.grid, rep(list(c(0,1)), n))
2005 Oct 25
1
Small issue with R's C API
Consider the R code: mat <- matrix(seq(1,20),4,5) is.matrix(mat) # gives TRUE is.vector(mat) # gives FALSE On the other hand, if mat is passed through the .Call interface the corresponding SEXP (call it smat) satisfies isMatrix(smat) // TRUE isVector(smat) // TRUE Consequently, you cannot distinguish matrices from vectors. Looking at the dim attribute of a vector doesn't help because
2005 Apr 18
2
Very Slow Gower Similarity Function
Hello, I am a relatively new user of R. I have written a basic function to calculate the Gower similarity function. I was motivated to do so partly as an excercise in learning R, and partly because the existing option (vegdist in the vegan package) does not accept missing values. I think I have succeeded - my function gives me the correct values. However, now that I'm starting to use it with
2017 Dec 29
1
winbuilder warning message wrt function pointers
And remove the cast on the return value of R_GETCCallable. And check that your function is found before using it. #include <R.h> #include <Rinternals.h> #include <R_ext/Rdynload.h> void bdsmatrix_prod4(int nrow, int nblock, int *bsize, double *bmat, double *rmat, int nfrail, double *y) { DL_FUNC fun = NULL; if (fun==NULL)
2017 Dec 29
3
winbuilder warning message wrt function pointers
I've recently updated the coxme package, which calls internal routines from the bdsmatrix package.? (It is in fact mentioned as an example of this in the Extensions manual.) The call connections are a blocks like this, one for each of the 9 called C routines. void bdsmatrix_prod4(int nrow,??? int nblock,?? int *bsize, ??????????????????? double *bmat, double *rmat, ??????????????????? int
2008 Aug 05
1
Fix for nls bug???
Hi All, I've hit a problem using nls. I think it may be a restriction in the applicability of nls and I may have found a fix, but I've been wrong before. This example is simplified to the essentials. My real application is much more complicated. Take a function of matrix 'x' with additional arguments: matrix 'aMat' whose values are _not_ to be determined by nls vector
2008 Jul 29
1
tensor product of equi-spaced B-splines in the unit square
Dear all, I need to compute tensor product of B-spline defined over equi-spaced break-points. I wrote my own program (it works in a 2-dimensional setting) library(splines) # set the break-points Knots = seq(-1,1,length=10) # number of splines M = (length(Knots)-4)^2 # short cut to splineDesign function bspline = function(x) splineDesign(Knots,x,outer.ok = T) # bivariate tensor product of
2009 Mar 05
3
methods package
I'm working on the next version of coxme, one step of which is converting the bdsmatrix library from Splus to R. Actually, it is a conversion from S4 methods as first described in the Green book to S4 methods as they currently exist. Mostly it's going ok, but not entirely. 1. The biggest issue is lack of documentation. The online help pages have not been a help; they keep saying
2012 Jul 12
1
SVAR Restriction on AB-model
Hello! I'm doing a svar and when I make the estimation the next error message appears: In SVAR(x, Amat = amat, Bmat = bmat, start = NULL, max.iter = 1000, : The AB-model is just identified. No test possible. Could you help me to interpret it please. Also I have the identification assumption that one of my shocks is exogenous relative to the contemporaneous values of the other variables
2010 Sep 29
1
location of Rconfig.h when using architecture-dependent subdirs
Hello, I just tried configuring R to use architecture-dependent subdirs $ r_arch=x86_64 ./configure --prefix=/u/smat/konis/testdir on a Debain Squeeze box $ uname -a Linux smapc007 2.6.32-5-686 #1 SMP Sat Sep 18 02:14:45 UTC 2010 i686 GNU/Linux After building and installing, the Rconfig.h ended up in .../lib/R/include/x86_64 but R.h still includes it as #include <Rconfig.h>
2009 Oct 12
1
Help Error
Hi R-users, I would like to ask question related to error output. If an error comments come out, then the program will automatically stop. I want to ask , how I can still continue the program even though there is an error comment? var=VAR(Canada,p=3,type="const") for (j in 1:nrow(com)) { mat=ma { for (i in 1:ncol(com)) { y=which(mat==com[j,i]) mat[y]=NA }
2003 Mar 18
1
Getting Compile errors
Hi I have downloaded samba-2.2.8 and I used the following command to compile the source. ./configure --prefix=/opt/samba --sysconfdir=/opt/samba/conf --with-smbmount --with-acl-support I got the following error when I tried to compile it. checking configure summary... ERROR: No locking available. Running Samba would be unsafe configure: error: summary failure. Aborting config The server is
2008 Aug 20
4
Conversion - lowercase to Uppercase letters
I would like to know how to convert a string with characters to all uppercase or all lowercase? If anyone could let me know if there exists a function in R for the conversion, that will be very helpful. Regards, Suman [[alternative HTML version deleted]]
2009 Jul 08
3
Unix commands on R
I am using R on unix. While in R how do I execute the unix shell commands? Is there a way to do it? I am executing a function in R and the matrix resulting from the function has to be passed on as an input to unix command. Any directions will be helpful. Thanks, Suman [[alternative HTML version deleted]]
2017 Dec 29
0
winbuilder warning message wrt function pointers
You can legally cast a function pointer to another function pointer, where the signatures differ. (It is not legal to cast between data and function pointers.) I would make typedefs for the various signatures, as the casting syntax is more readable then. Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Dec 29, 2017 at 10:13 AM, Therneau, Terry M., Ph.D. < therneau at mayo.edu> wrote:
2011 Sep 03
2
problem in applying function in data subset (with a level) - using plyr or other alternative are also welcome
Dear R experts. I might be missing something obvious. I have been trying to fix this problem for some weeks. Please help. #data ped <- c(rep(1, 4), rep(2, 3), rep(3, 3)) y <- rnorm(10, 8, 2) # variable set 1 M1a <- sample (c(1, 2,3), 10, replace= T) M1b <- sample (c(1, 2,3), 10, replace= T) M1aP1 <- sample (c(1, 2,3), 10, replace= T) M1bP2 <- sample (c(1, 2,3), 10, replace= T)
2008 Jul 18
6
Xen-3.2.1 Build Error
This is the error I get while building Xen-3.2.1 when I do a make =============================================== make[2]: Entering directory `/usr/src/xen-3.2.1/tools/check'' LIBXENAPI_BINDINGS=n ACM_SECURITY=n ./chk build Xen CHECK-BUILD Fri Jul 18 11:36:34 IST 2008 Checking check_crypto_lib: OK Checking check_curl: unused, OK Checking check_openssl_devel: *** Check for openssl
2008 Feb 18
4
Lustre-1.5.95 & Linux-2.6.18
Will lustre-1.5.95 build with 2.6.18-vanilla kernel? Which_patch doesn''t contain this kernel but I could see them in the series files. Do somebody have experience in building the same? I tried to do it but lot of errors after applying the patches in 2.6.18-vanilla series. Thanks, Venkat
2007 Jun 27
3
Correlation ratio
Hi, I wanted to know how to compute the correlation ratio (eta) between two variables using R. Is there any function to compute the correlation ratio. Any help will be very much appreciated. Thanks, Suman [[alternative HTML version deleted]]