similar to: the matrix of rows with specific row sums

Displaying 20 results from an estimated 9000 matches similar to: "the matrix of rows with specific row sums"

2006 Oct 27
3
How to best divide table by table
Hi all, how can I divide two tables of the same dimension so that all names are preserved, ie do not become NA? I have "tab1" and "tab2", each having names in the first column. I want "tab3" with the same names and values "tab1/tab2". Thanks, Serguei
2006 Mar 03
3
Two quick questions
Hi all, 1. How to construct a date from three variables year, month, and day, where all three are integers? 2. I have a dataframe by date and sector. I would like to add-up all entries for all variable with identical date and sector, replacing the original entries, i.e. emulate the STATA command "collapse (sum) var1 var2 var3, by(date sector)". Thank you, Serguei Kaniovski
2006 Oct 09
1
Coefficients of a factorized polynomial
Hi all, starting from a vector "v[1:n]" I would like to compute the coefficients of the polynomial (1+x^v[1])*(1+x^v[2])*...*(1+x^v[n]). The following code works but is extremely slow for a large "n" due to, I believe, the polynomial being factorized. I wanted to try the package "polynom" command "unclass" but I could not figure out how to input a
2005 Dec 05
5
What is wrong with this FOR-loop?
Hi, I have a more complex example, but the problem boils down to this FOR-loop not filling in the res-matrix run_rows<-seq(0,1,0.05) run_cols<-seq(0.3,0.6,0.05) res<-matrix(NA,length(run_rows),length(run_cols)) for(i in run_rows) { for(j in run_cols) { res[i,j]=i+j #niether the above, nor res[[i,j]]=i+j work, why? } } Thank you, Serguei
2005 Dec 03
1
Correlation matrix from a vector of pairwise correlations
I've a vector of pairwise correlations in the order low-index element precedes the high-index element, say: corr(1,2)=0.1, corr(1,3)=0.2, corr(2,3)=0.3, corr(3,4)=0.4 How can I construct the corresponding correlation matrix? I tried using the "combn"-function in "combinat" package: library(combinat) combn(c(0.1,0.2,0.3,0.4),2) , but to no avail... Thank you for your
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
2000 Apr 26
2
Rapid transfers cause kernel panic
Our site has been experiencing problems with Samba causing kernel panics under heavy use. We are running Mandrake 7.0 and Samba 2.0.6. We are no longer using the distro included with Mandrake - we actually downloaded the 2.0.6 release and recompiled. Downloading from Samba shares causes no problems - and downloads are frequent and heavy - but uploading similar amounts of data leaves a catatonic
2007 Feb 26
1
Adding duplicates by rows
Hi, I am trying to add duplicates of matrix "mat" by row. Commands subset(mat,duplicated(rownames(mat))) or mat[which(duplicated(rownames(mat))),] return only half of the required indices. How can I find the remaining ones, ie the matches, so that I can add them up? Thanks, Serguei ___________________________________________________________________ Austrian Institute of Economic
2007 Feb 22
4
Sorting rows of a binary matrix
Hallo, The command: x <- 3 mat <- as.matrix(expand.grid(rep(list(0:1), x))) generates a matrix with 2^x columns containing the binary representations of the decimals from 0 to (2^x-1), here from 0 to 7. But the rows are not sorted in this order. How can sort the rows the ascending order of the decimals they represent, preferably without a function which converts binaries to decimals
2006 Jul 18
2
A contingency table of counts by case
Here is an example of the data.frame that I have, df<-data.frame("case"=rep(1:5,each=9),"id"=rep(1:9,times=5),"x"=round(runif(length(rep(1:5,each=9))))) "case" represents the cases, "id" the persons, and "x" is the binary state. I would like to know in how many cases any two persons a. both have "1", b. the first has
2000 Feb 16
2
Embedding samba...
Hi All, I am working on a port of Samba to the uClinux/ColdFire system. This is a port of Linux running on the Motorola ColdFire processors. These processors have no MMU, so no virtual memory. It also means that there is no true fork() call, only a vfork() type primitive is supported. Other than this the fact that there is no MMU is pretty transparent applications, it looks like any other Linux
2009 Aug 11
1
Help on a combinatorial task (lists?)
Hello! I have the following combinatorial problem. Consider the cumulative sums of all permutations of a given weight vector 'w'. I need to know how often weight in a certain position brings the cumulative sums equal or above the given threshold 'q'. In other words, how often each weight is decisive in raising the cumulative sum above 'q'? Here is what I do: w <-
1999 Oct 15
1
99.9% uptime
Sorry, forgot to change the subject on my first posting. I was reading a comment this morning about something Microsoft had published to the effect that there were vendors guaranteeing 99.9% uptime for NT. The guy who wrote the reply did the math for what that means, and the results are very interesting. Quote below: OK, now what does a 99.9% uptime guarantee mean? Well, it means that at
1999 Sep 13
2
smbfs mounted files created owned by root?
Hi all. We have been denying NFS access to our Linux et al users since they can of course set their uid to whatever they want. So we tell them to use smbfs. But when I just tried experimenting by mounting my own network share on my Linux box via smbfs, and created a few files, I loo on the serevr and the files are all owned by root?! This has got to be a configuration issue right? -- Mark E
2006 Dec 14
3
Delete all dimnames
Hello, how can I get rid of all dimnames so that: $amat Var3 Var2 Var1 8 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 7 1 1 1 0 1 0 0 0 1 0 0 0 0 0 0 6 1 1 0 1 0 1 0 0 0 1 0 0 0 0 0 5 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 4 1 0 1 1 0 0 1 0 0 0 0 1 0 0 0 3 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 2 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0
2007 Nov 28
4
Replacing values job
Hallo, I have two vectors of different lengths which contain the same set of values: X < -c(2,6,1,7,4,3,5) Y <- c(1,1,6,4,6,1,4,1,2,3,6,6,1,2,4,4,5,4,1,7,6,6,4,4,7,1,2) How can I replace the values in Y with the index (!) of the corresponding values in X. So 2 appears in X in the first coordinate, so all 2’s in Y should be replaced by 1, etc. Thank you for your help, Serguei
2006 Sep 22
3
Compiling a contingency table of counts by case
I have asked a similar question before but this time the problem is somewhat more involved. I have the following data: case;name;x 1;Joe;1 1;Mike;1 1;Zoe;1 2;Joe;1 2;Mike;0 2;Zoe;1 2;John;1 3;Mike;1 3;Zoe;0 3;Karl;0 I would like to count the number of "case" in which any two "name" a. both have "x=1", b. the first has "x=0" - the second has
2007 Feb 06
1
Questions on counts by case
Hi all, for the data below I would like to 1. generate a dummy variable for each group "gr" of the same composition by people, then save each portion in a separate file, 2. compute the frequency of "1"'s in "x" for each person by group "gr". So, "mike" will have freq=2/3, as he has two "1" and one "0" in 3 groups.
2005 Dec 04
4
Construct a data.frame in a FOR-loop
Say I have a FOR-loop for computing powers (just a trivial example) for(i in 1:5) { x<-i^2 y<-i^3 } How can I create a data.frame and a 3D plot of (i,x(i),y(i)), i.e. for each iteration Thanks, Serguei Kaniovski -- ___________________________________________________________________ ??sterreichisches Institut f??r Wirtschaftsforschung (WIFO) Name: Serguei Kaniovski
2007 Nov 28
1
Order observations in a dataframe
Dear All, Suppose I have the following dataframe: country;weight;group bul;10;1 cze;12;1 grc;12;1 hun;12;1 prt;12;1 rom14;1 fra;29;2 ita;29;2 gbr;29;2 aut;10;3 bel;12;3 The "group" variable denotes the id-number of a group of countries. How can I re-label the groups in the descending order of their cumulative "weight", which wound be: country;weight;group fra;29;1 ita;29;1