similar to: Proper apply function for matrices embedded in lists

Displaying 20 results from an estimated 9000 matches similar to: "Proper apply function for matrices embedded in lists"

2012 Apr 02
2
sampling rows from a list
Hi: I'm sure this seems like a rudimentary question, but I am not well versed with R syntax for lists. I have a ragged array from which I've removed records (entire rows) with missing data. The functions I used to remove the missing cases resulted in the generation of an R list class object, that looks something like this; mydata [[1]] [,1] [,2] [,3] [1,] 1 2 3 [2,] 4
2012 Mar 30
1
removing NA from multidmension arrays
Hi: I'm having some difficulty properly subscripting a function to remove complete NA rows from a R array object. Could someone please suggest how best to script this out? Data structure: X is an array with 3 dimensions (replicates, Species, Sites) replicates: 1 to 6 but ragged...not all sites equal ,,Site1 Sp1 Sp2 Sp3... Sp50 1 5 4 3 2 2 3 0 0 1 3 NA NA NA NA 4 NA NA NA NA 5 NA
2009 Aug 18
2
Embedding lists in matrices and matrices in lists
Hi, I'm new to programming, new to R and even new to mailing lists so please be patient with me. I need to manage many matrices generated by an R program. These matrices have different dimensions and I'd like to group them somehow. The best way would be to have a big matrix (let's call it database) where every element database[x,y] consists of a list of matrices that all have the
2012 Apr 26
1
proper way to snapshot
Hi, While there are a few howtos floating around, what is the standard way to snapshot guests? I went through and converted from raw to pre allocated meta data qcow2 images for this purpose. Some howtos suggest to do an xml snapshot file as so; <domainsnapshot> <name>UbuntuServer_10.10-16032011</name> <description>Snapshot of OS install and
2012 Nov 06
1
plm(): observations not used for modelling
Hello, I have posted this problem before, but thought I try to explain it a bit better. I'm using the function plm to create a fixed effects model for panel data, my method is therefor "within" my effect is "twoways". My Data contains unbalanced Panels due to missing Values, but contains 309 observation for 11 variables (incl. response), with no missing Values. These 309
2012 Sep 14
2
calculate within-day correlations
useRs, Here is some R-ready data for my question to follow. Of course this data is small snippet from a much larger dataset that is about a decade long. Q<-read.table(textConnection("2002 3 28 15 77.38815 2002 3 28 30 77.09505 2002 3 28 45 76.80196 2002 3 28 60 76.50887 2002 3 28 75 76.50887 2002 3 28 90 76.50887 2002 3 28 105
2005 Nov 23
2
vector of permutated products
Given an x-vector with, say, 3 elements, I would like to compute the following vector of permutated products (1-x1)*(1-x2)*(1-x3) (1-x1)*(1-x2)*x3 (1-x1)*x2*(1-x3) x1*(1-x2)*(1-x3) (1-x1)*x2*x3 x1*(1-x2)*x3 x1*x2*(1-x3) x1*x2*x3 Now, I already have the correctly sorted matrix of permutations! So, the input looks something like: #input x<-c(0.3,0.1,0.2) Nx<-length(x) Ncomb<-2^Nx
2013 Jan 03
5
splitting matrices
Dear useRs, i want to split a matrix having 1116rows and 12 columns. i want to split that matrix into 36 small matrices each having 12 columns and 31 rows. The big matrix should be splitted row wise. which means that the first small matrix should copy values which are in first 31 rows and 12 columns of the big matrix. similarly 2nd small matrix should contain values from 32nd to 63rd row of the
2009 Jan 24
1
Environment change?
So i have a simple question that doesnt require sample code, not sure if that violates posting rules or not. Is this: [1] "111" "112" "113" "114" "115" "116" "118" "119" "120" "123" "125" "126" [13] "127" "128" "132" "137"
2013 Feb 27
2
matrix multiplication
Hi, Try this: #mat1 is the data res<-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i) {new1<-do.call(rbind,lapply(seq_len(nrow(mat1[-i,])),function(j) {x1<-rbind(mat1[i,],mat1[j,]); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[2,2])*abs(x1[1,6]-x1[2,6]))+(abs(x1[1,3]-x1[2,3])*abs(x1[1,7]-x1[2,7]))+(abs(x1[1,4]-x1[2,4])*abs(x1[1,8]-x1[2,8]))}));new1}))
2005 Sep 03
2
xen unstable build domU kenel fails on entry.S
amd64:/usr/src/xen-unstable.hg#hg tip changeset: 6597:a1de77c1486c5f35884e9f578b7f33b6bd75c362 tag: tip user: shand@ubuntu.eng.hq.xensource.com date: Sat Sep 3 03:36:29 2005 summary: Enable ''live'' migration from a tools pov; prior to this the ''live'' flag was Which option in make ARCH=xen menuconfig should i disable to get rid of
2013 May 06
2
BIOENV
Dear all, Does anyone knows why the results of a BIOENV (PRIMER v. 6.1.15) are diferent of the bioenv() + mantel() in vegan? Not the spearman correlation, indeed the pseudo-p value. I know that the approach bioenv() + mantel() is biased. So, how the BIOENV (PRIMER) ends with larger p values (permutated). Acctualy how the permutation test in BIOENV (PRIMER) is conducted. The user guide does not
2013 Apr 17
1
stack imbalance in max.col for non-real matrices
It's tough to reliably reproduce, but I often get stack imbalance warnings when calling max.col() on non-real/double matrix. The code is conditionally PROTECTing but not incrementing its nprot counter for the eventual UNPROTECT. Pretty sure this would fix (but I haven't tested it): Index: array.c =================================================================== --- array.c (revision
2010 Apr 13
2
how to work with big matrices and the ff-package?
Hello everyone, I need to create and work with some big matrices that actually have somewhat over 2 million columns and 117 rows. To do some calculations on such big matrices R just needs too much memory for my PC (4GB installed). So I need a solution to work with large datasets. I'm trying to use the ff-package but I don't think I really understand the whole functionality of the
2007 Aug 09
1
How to apply functions over rows of multiple matrices
Dear ExpRts, I would like to perform a function with two arguments over the rows of two matrices. There are a couple of *applys (including mApply in Hmisc) but I haven't found out how to do it straightforward. Applying to row indices works, but looks like a poor hack to me: sens <- function(test, gold) { if (any(gold==1)) { sum(test[which(gold==1)]/sum(which(gold==1))) } else NA }
2007 Oct 09
1
Handling two lists of matrices
I'm having trouble setting up the function call to handle two lists of matrices. Each list has 6 matrices - Each matrix is 20x10. I need to do some basic math on corresponding matrices in each list. Here are some outputs of these lists, etc... # first list > length(qc.pm) [1] 6 > dim(qc.pm[[1]]) [1] 20 10 > qc.pm[[1]][1:4,1:4] 441-JP071707.CEL 442-JP071707.CEL
2005 Aug 16
1
permutated p values vs. normal p values
Hi, I am performing Cox proportional hazards regression on a microarray dataset with 15000 genes. The p values generated from the Cox regression (based on normal distribution of large sample theory) showed only 2 genes have a p value less than 0.05. However, when I did a permutation on the dataset to obtained permutated p values, and it turned out about 750 genes had a permutated p value less than
2012 Feb 09
1
How to properly build model matrices
I always bump into a few (very minor) problems when building model matrices with e.g.: train = model.matrix(label~., read.csv('train.csv')) target = model.matrix(label~., read.csv('target.csv')) (1) The two may have different factor levels, yielding different matrices. I usually first rbind the data frames together to "meld" the factors, and then split them apart and
2004 May 18
1
Asterisk on OS X
Hello, I have researched a few postings where users mentioned being able to install Asterisk on Mac OS X Panther by adding some code after line 165 in the Makefile and then compiling. This has been unsuccessful for me. I downloaded the asterisk-0.9.0.tar.gz tarball and am trying to install from it. The output I get upon trying to make after editing the Makefile can be viewed at:
2000 Dec 26
1
More on scan: extra field at end of line
Suppose, I have a file "data1" containing: 450 390 467 654 30 542 334 432 421 357 497 493 550 549 467 575 578 342 446 547 534 495 979 479 I can read this file with: scan("data1") Read 24 items [1] 450 390 467 654 30 542 334 432 421 357 497 493 550 549 467 575 578 342 446 [20] 547 534 495 979 479