Displaying 20 results from an estimated 2000 matches similar to: "random roundoff?"
2009 Sep 09
2
Matrix multiplication and random numbers
Dear All
I new to using R and am struggling with some matrix multiplication.
I have two matrices, one containing random numbers, these are multiplied
together to get another matrix which is different each time. When I put in
another for loop to repeat this process a multiple times the matrices are
all the same. I?m sure there is a way to keep the randomness of the
different matrices but I think
2010 Mar 29
2
Need help on matrix manipulation
Dear all,
Ket say I have 3 matrices :
mat1 <- matrix(rnorm(16), 4)
mat2 <- matrix(rnorm(16), 4)
mat3 <- matrix(rnorm(16), 4)
Now I want to merge those three matrices to a single one with dimension
4*3=12 and 4 wherein
on resulting matrix, row 1,4,7,10 will be row-1,2,3,4 of "mat1", row
2,5,8,11 will be row-1,2,3,4 of "mat2" and row 3,6,8,12 will be row-1,2,3,4
of
2010 Jan 29
7
Simple question on replace a matrix row
Hello, I have a matrix mat1 of dim [1,8] and mat2 of dim[30,8], I want to
replace the first row of mat2 with mat1, this is what I do:
mat2[1,]<-mat1 but it transforms mat2 in a list I don't understand, I want
it to stay a matrix...
-----
Anna Lippel
--
View this message in context: http://n4.nabble.com/Simple-question-on-replace-a-matrix-row-tp1427857p1427857.html
Sent from the R help
2008 Aug 29
2
Newbie: Examples on functions callling a library etc.
Hello
R is pretty new to me. I need to write a function that returns three
matrices of different dimensions. In addition, I need to call a function
from a contributed package with the function. I have browsed several
manuals and docs but the examples on them are either very simple or
extremely hard to follow.
Many thanks
Ed
[[alternative HTML version deleted]]
2010 Jan 27
1
How to sort data.frame
Dear R heleprs
Suppose I have following data
Scenarios
combination_names
series1
series2
Sc1
MAT2 GAU1
7.26554
8.409778
Sc2
MAT2 GAU2
7.438128
8.130275
Sc3
MAT3 GAU1
8.058422
8.06457
Sc4
MAT1 GAU2
8.179855
8.022071
Sc5
MAT3 GAU2
8.184033
8.191831
Sc6
MAT3 GAU2
7.50312
8.232425
Sc7
MAT1 GAU2
7.603291
8.200993
Sc8
MAT1 GAU1
8.221755
8.380097
Sc9
MAT3 GAU2
7.904908
2010 Oct 14
1
rbind ing matrices and resetting column numbers
Sorry for the verbose example. I want to row bind two matrices, and all works except I want the column labelled "row" to be sequential in the new matrix, shown as "mat3" here, i.e. needs to be 1:6 and not 1:3 repeated twice. Any suggestions?
Thanks
J
> colnm1 <- c("row","ti","counti")
> colnm2 <-
2013 Feb 01
2
Nested loop and output help
Hello Everyone,
My name is Thomas and I have been using R for one week. I recently found
your site and have been able to search the archives of posts. This has
given me some great information that has allowed me to craft an initial
design to an inquiry I would like to make into the breakdown of McNemar's
test. I have read an intro to R manual and the posting guides and hope I am
not violating
2005 Apr 29
1
na.action
Hi,
I had the following code:
testp <- rcorr(t(datcm1),type = "pearson")
mat1 <- testp[[1]][,] > 0.6
mat2 <- testp[[3]][,] < 0.05
mat3 <- mat1 + mat2
The resulting mat3 (smaller version) matrix looks like:
NA 0 0 0
0 NA 0 NA
0 0 NA 2
0 0 2 NA
To get to the number of times a '2' appears in the rows, I was
2009 May 19
3
how to calculate means of matrix elements
useR's,
I have several matrices of size 4x4 that I want to calculate means of their
respective positions with. For example, consider I have 3 matrices given by
the code:
mat1 <- matrix(sample(1:20,16,replace=T),4,4)
mat2 <- matrix(sample(-5:15,16,replace=T),4,4)
mat3 <- matrix(sample(5:25,16,replace=T),4,4)
The result I want is one matrix of size 4x4 in which position [1,1] is the
2013 Feb 13
3
date and matrices
Hi Elisa,
Try this:
date1<-format(seq.Date(as.Date("1991.1.1",format="%Y.%m.%d"),as.Date("1996.12.31",format="%Y.%m.%d"),by="day"),"%Y.%m.%d")
?length(date1)
#[1] 2192
mat1<-matrix(c(.314,.314,.273,.273,.236,.236,.236,.236,.273,.314,.403,.314),ncol=1)
res1<-
2010 Mar 02
2
turn character string into unevaluated R object
Hi,
How to turn a character string into an unevaluated R object? I want to load some files in a directory into data matrix R objects. I could do this with read.table and assign (see below). Then, I want to turn the character string representing a file name (the evaluated expression of i) into an unevaluated R object. Basically, I want to create matrices whose names are the same as the related file
2013 Jan 04
2
Working with Matrix
Hello again,
Let say I have 2 matrices which equal number of columns but different
number of rows like:
Mat1 <- matrix(1:20, 4, 5)
Mat2 <- matrix(1:25, 5, 5)
Now for each column 1-to-5 I need to fetch the corresponding columns
of these 2 matrices and add the corresponding elements (ignoring NA
values if any). Therefore for the 1st column I need to do:
(1+1), (2+2),...,(4+4), (NA+5)
and
2011 Mar 03
3
top and allocation issues
In a context where exceptions are caught, I ran
the fragment:
cerr << "allocating" << endl;
char* arr[100];
for (int jj = 0; jj < 10; ++jj)
{
cerr << "jj = " << jj << endl;
arr[jj] = new char[2000000000];
sleep (30);
}
sleep (10);
for (int jj = 0; jj < 10; ++jj)
delete[] arr[jj];
cerr
2006 Mar 19
1
[LLVMdev] Idioms for retrieving global symbols and inheritance
Hello,
I have a couple of doubts, as listed below:
1. To list all the global variables in the module, I am iterating
using type_iterator and for each Type I get, I am using value_iterator
to iterate over Values . In the second iteration I am getting
unexpected results. For each type obtained from type_iterator->second,
value_iterator->first produces the same list as what
2006 May 31
0
[LLVMdev] Adding an object to llc (analysis pass)
On Wed, 31 May 2006, Silken Tiger wrote:
>> that requires a BasicBlockPass, it will fail the same was as when a
>> ModulePass requires a FunctionPass.
> void MParSchedule::getAnalysisUsage(AnalysisUsage &AU) const {
> AU.setPreservesAll();
> }
>
> MParSchedule requires nothing and changes nothing. So hopefully the above code
> represents this fact?
Right
2009 Mar 11
3
[LLVMdev] opt -O2/-O3 does not Initialize pass?
Hello,
I'm writing a pass that adds a function prototype to the module during
doInitialization() and stores the pointer in a global variable. If I
run opt with "-O1" or less, everything works fine. However, If I call
opt with "-O2" or "-O3" then as soon as runOnFunction() is called, the
pointer seems to be NULL. Here is a code that shows the problem:
2011 May 11
3
Reordering inputs
Hello All,
I have 2 matrices consisting of the same inputs, but having different
outputs. I created a heatmap for both of them; the point is to compare them
side by side. The best way to organize the inputs is to make sure that the
order of the inputs are the same for both heatmaps. How would I go about
making sure that the order of inputs of both heatmaps are the same?
As it is right now, I can
2006 May 31
2
[LLVMdev] Adding an object to llc (analysis pass)
Hi
Am Dienstag, 30. Mai 2006 19:21 schrieb Chris Lattner:
> On Tue, 30 May 2006, Silken Tiger wrote:
> > Everthing now compiles fine, but when running llc with invoking my own
> > backend derived from the cbackend i get the following error:
> > namespace llvm {
> > class MParSchedule : public BasicBlockPass {
> > public:
> >
> >
2008 Oct 03
2
suggestions for plotting 5000 data points
Dear all,
I have a collection of 5000 entries which represent the evolutionary
rates of 3 animals.
I would like to show the differences between the rates of all 3
animals and have tried using the function parallel (from the lattice
package) and pairs() function.
The parallel function would have been perfect save for the large
number of data (5000). The pairs() function doesn't show
2012 Oct 07
1
variances of random effects in coxme
Dear R users,
I'm using the function coxme of the package coxme in order to build Cox
models with complex random effects. Unfortunately, I sometimes get
surprising estimations of the variances of the random effects.
I ran models with different fixed covariates but always with the same 3
random effects defined by the argument
varlist=coxmeMlist(list(mat1,mat2,mat3), rescale = F, pdcheck = F,