Displaying 20 results from an estimated 1000 matches similar to: "deleting invariant rows and cols in a matrix"
2005 Oct 06
3
Singular matrix
Dear All,
I have written the following programs to find a non-singular (10*10) covariance matrix.
Here is the program:
nitems <- 10
x <- array(rnorm(5*nitems,3,3), c(5,nitems))
sigma <- t(x)%*%x
inverse <- try(solve(sigma), TRUE)
while(inherits(inverse, "try-error"))
{
x <- array(rnorm(5*nitems,3,3), c(5,nitems))
sigma <- t(x)%*%x
inverse <-
2011 Oct 24
3
Create a matrix with increment and element with zero subscript
Hello,
Does anyone knows how to deal with zero subscript in R. I have this code:
for (i in 1:nitems){
+ for (j in 1:ncat-1) {
+ draw<-matrix(rnorm(nitems*(ncat-1),seed1,seed2),nitems,(ncat-1))
+ d<-( sigma_d*draw ) + mu_d
+ draw<-matrix(rtnorm((nitems*(ncat-1)),mean = seed1, sd = seed2, lower = .1, upper = 1.5),nitems,(ncat-1))
+
2005 Aug 22
2
RFC: "loop connections"
I've just implemented a generalization of R's text connections, to
also support reading/writing raw binary data. There is very little
new code to speak of. For input connections, I wrote code to populate
the old text connection buffer from a raw vector, and provided a new
raw_read() method. For output connections, I wrote a raw_write() to
append to a raw vector. On input, the mode
2007 Jun 24
1
There was a problem by the use of snow.
problem of the very large memory require by the Sign extension.
--- R-2.5.0.orig/src/main/serialize.c 2007-03-27 01:42:08.000000000 +0900
+++ R-2.5.0/src/main/serialize.c 2007-06-25 00:48:58.000000000 +0900
@@ -1866,7 +1866,7 @@
static void resize_buffer(membuf_t mb, int needed)
{
- int newsize = 2 * needed;
+ size_t newsize = 2 * needed;
mb->buf = realloc(mb->buf,
2005 Sep 18
0
Updated rawConnection() patch
Here's an update of my rawConnection() implementation. In addition to
providing a raw version of textConnection(), this fixes two existing
issues with textConnection(): one is that the current textConnection()
implementation carries around unprotected SEXP pointers, the other is
a performance problem due to prolific copying of the output buffer as
output is accumulated line by line.
This new
2014 May 20
1
Question about fifo behavior on Linux between versions 3.0.3 and 3.1.0
Version 3.1.0 of R has imposed a very small data limit on writing to fifos on Linux. Consider the following R code (Assumes that "ff" is a fifo in the R process's current directory):
con <- fifo("ff", "a+b")
writeBin(raw(12501), con)
In R 3.0.3, this returns without error and the data is available on the fifo. In R 3.1.0, however, this returns the following
2005 Apr 05
4
lists: removing elements, iterating over elements,
I'm writing R code to calculate Hierarchical Social Entropy, a diversity
index that Tucker Balch proposed. One article on this was published in
Autonomous Robots in 2000. You can find that and others through his web
page at Georgia Tech.
http://www.cc.gatech.edu/~tucker/index2.html
While I work on this, I realize (again) that I'm a C programmer
masquerading in R, and its really
2007 Mar 19
1
xclip and wine
Hello
I perform the following command
$ echo "Text to clipboard" | xlip -i -selection clipboard
$ xclip -o -selection clipboard
Text to clipboard
I can also paste the text in mozilla by pressing shift-insert.
I cannot paste it into application running under Wine.
I have to invoke ctrl-insert explicitly on selected text in order to be
able to paste it into this wine application.
Do
2007 Apr 14
0
[966] branches/wxruby2/wxwidgets_282/doc/textile/listbox.txtl: Fix methods which don''t need a ''n'' item for arrays in Ruby
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding:
2007 Apr 14
0
[965] branches/wxruby2/wxwidgets_282/doc/textile: Misc.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding:
2006 Oct 19
0
[687] trunk/wxruby2/swig/classes/Pen.i: Remove a malformed and unneeded typemap (Roy Sutton)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding:
2003 Sep 25
2
Bugs compiling R-1.7.1 with Intel compilers icc and ifc (PR#4295)
Bugs compiling R-1.7.1 with Intel compilers icc and ifc,
on x86-computer (Pentium IV) and linux operating system
Hello,
as there aren't many reports about that issue, I'll give a little
report here. (Hope I don't bother anyone)
The best thing about using icc and ifc are the warnings, because
it is said that the Intel compilers are stricter and give more
precise warnings than gcc.
2002 Mar 02
3
sorting listview by clicking header
thanks to all of the great work that has been done to listview, my app
is finally readable. cudos on the latest patch that fixed up text
(that was getting truncated), it's correct this time around. anyways,
the one thing missing to get my app working is column sorting (done by
clicking a header). i have below the output from a
"trace+listview,trace+header" run of the app, clipped
2005 Apr 08
2
DLL Memory Problem
Hello,
I have created a .dll file using G77 and MinGW on my PC (Windows
2000). After using dyn.load to bring it into R2.0.1, I then call the .dll
through the function ccprox shown below. It returns the correct
values. If I run it a second time though it returns different values, so
it seems something is being placed oddly in memory.
If I unload and reload the .dll it works again the first
2011 Apr 04
2
reading from text file that have different rowlength and create a data frame
Hi R-experts
I have many text files to read and combined them into one into R that are
output from other programs. My textfile have unbalanced number of rows for
example:
;this is example
; r help
Var1 Var2 Var3 Var4 Var5
0 0.05 0.01 12
1 0.04 0.06 18 A
2 0.05 0.08 14
3 0.01 0.06
2001 Jul 10
1
Interpreting message: Error in names<-.default(*tmp*, value = cols) :
I have an error message that I don't know how to interpret.
The message is:
Error in names<-.default(*tmp*, value = cols) :
names attribute must be the same length as the vector
I have written a complicated analysis algorithm to examine a large
dataset. The analysis appears to run on small numbers of tokens, say 10.
I suppose my question is: which function(s) might kick out such
2012 Apr 05
1
Sum of sd between matrix cols vs spearman correlation between them
Hi all,
I have a matrix (n*2), I want to compare 2 operators (2 normalization for
array results) on these matrix.
The 2 columns should ideally become the same after operations
(normalization). So to compare operations,
I do this for each normalization:
s= sum (apply (normalized.matrix, 2,sd))
c= cor (normalized[,1],normalized [,2], method='pearson')
I expect that if normalization 1
2003 Feb 10
1
Zero rows/cols in the hessian matrix
Dear R experts!
I try to minimize a function with external C fitting function.
I get the hessian matrix. Here it is:
[,1] [,2] [,3] [,4]
[1,] 1.8816631 0 0.8859803 0
[2,] 0.0000000 0 0.0000000 0
[3,] 0.8859803 0 0.4859983 0
[4,] 0.0000000 0 0.0000000 0
Second and fourth rows/columns have zero values only. That's OK,
because that ones related
2009 Apr 21
3
Deleting rows or cols that do not meet cut off
How can I delete both rows and columns that do not meet a particular cut off value.
Example:
> d <- rbind(c(0, 1, 6, 4),
+ c(2, 5, 7, 5),
+ c(3, 6, 1, 6),
+ c(4, 4, 4, 4))
> f <- as.matrix(d)
> f
[,1] [,2] [,3] [,4]
[1,] 0 1 6 4
[2,] 2 5 7 5
[3,] 3 6 1 6
[4,] 4 4 4 4
I would like to delete all
2008 Jun 12
3
Adding new columns to (output) data - e.g., read 5 cols write 8
Hello, I have the following task I'd like to accomplish:
A file contains 5 columns of data (several hundred rows), let's call
them a, b, c, d and e (ie these are their column headers)
I also have a set of definitions, e.g.,
f = a + b
g = a * 3
h = c + d
etc.
I would like to write out a new .rda file that contains columns
a b c d e f g h etc.
I.e. , the original data plus new columns