Displaying 20 results from an estimated 500 matches similar to: "how to apply several math/logic operations on columns/rows of a matrix"
2009 Nov 16
2
parsing Google search results
Hi,
how can I parse Google search results? The following code returns
"integer(0)" instead of "1" although the results of the query clearly
contain the regex "cran".
####
address <- url("http://www.google.com/search?q=cran")
open(address)
lines <- readLines(address)
grep("cran", lines[3])
####
Thanks
Philip
--
Philip Leifeld
Max
2009 Jul 09
2
r bug (?) display of data
Hi R Fans,
I stumbled across a strange (I think) bug in R 2.9.1. I have read in a
data file with 5934 rows and 9 columns with the commands:
daten = data.frame(read.table("C:/fussball.dat",header=TRUE))
Then I needed a subset of the data file:
newd = daten[daten[,1]!=daten[,2],]
--> two values do not meet the logical specification and are dropped.
The strange thing about it:
2010 Jan 31
1
R performance
Dear R Fans,
I was recently asking myself how quick R is in code execution. I have
been running simulations lately that need quite a time for execution and
I was wondering if it is reasonable at all to do more computational
extensive projects with R. Of course, it is possible to compare
execution time for the same code written in several languages but maybe
someone has some experience on the
2012 Jan 30
1
Quantum scalar i40 tape partitions
Hi All,
I have a Quantum scalar i40 tape library. I need to configure it to TWO tape partition libraries, e.g., library_a and library_b, so that each library has its own tape drive. Then connect this physical tape library to two different CentOS servers so that each server can see its own media changer and tape drive. I once had a successful configuration on one host but NOT on the other. One
2004 Nov 25
4
Avoiding for-loops
Hello R-users,
I have a symmetric matrix of numerical values and I
want to obtain those values in the upper or lower
triangle of the matrix in a vector. I tried to do the
job by using two for-loops but it doens't seem to be a
clever way, and I'd like to know a more efficient code
for a large matrix of thousands of rows and columns.
Below is my code for your reference.
Thanks a lot.
2010 Apr 23
2
Matrix diagonal help
Hi
Suppose I have a matrix (cohort are rows and years are columns)
[2000] [2001] [2002] [2003]
[C1] 0.01 0.03 0.02 0.09
[C2] 0.06 0.05 0.07 0.11
[C3] 0.1 0.5 0.4 0.98
[C4] 0.7 0.6 0.2 0.77
I want to extracts the diagonals to get a matrix which looks like this (C1
becomes C2 in 2002, C2 becomes C3 in 2003
2005 May 19
14
R annoyances
Dear R Folks,
I'm a big fan of R, but there are a couple of things
that repeatedly annoy me, and I wondered if anyone
has neat ways to deal with them.
(a) When using "apply" row-wise to a matrix, it returns
the results column-wise, and to preserve the original
orientation, I've to do a transpose. E.g. I've to keep
doing a transpose, which I consider to be quite
2008 Mar 13
3
Overland Arcvault 12 and sequential/random settings
My unit's firmware: library 05.03, tape d22h, shows the device as set to
random mode. But mtx -f /dev/st0 status gives an error that google says
the device is in sequential mode. dmesg|grep -i hp does reflect CentOS
thinks the device is a sequential unit.
I've tried this with Fedora 8, too, and both show the same, so it is
either an issue with CentOS/Fedora RPMs, or the version of
2004 Nov 02
3
n-th power of a matrix
Hello all,
To calculate the power of a matrix, I used the command "mtx.exp(X, n)", but
there is an error saying "Error: couldn't find function "mtx.exp"". How can
I deal with this problem?
Jing
2005 Feb 23
1
H-F corr.: covariance matrix for interaction effect
Hi,
I'm still not quite there with my H-F (G-G) correction code. I have it
working for the main effects, but I just can't figure out how to do it
for the effect interactions. The thing I really don't know (and can't
find anything about) is how to calculate the covariance matrix for the
interaction between the two (or even n) main factors.
I've looked through some books
2005 Feb 23
1
H-F corr.: covariance matrix for interaction effect
Hi,
I'm still not quite there with my H-F (G-G) correction code. I have it
working for the main effects, but I just can't figure out how to do it
for the effect interactions. The thing I really don't know (and can't
find anything about) is how to calculate the covariance matrix for the
interaction between the two (or even n) main factors.
I've looked through some books
2008 May 14
6
PWGL in wine, problems
Hello,
I'm new on this list. First of all, thank you to all the developers of this
great project!
At the moment there is only an application that keeps me on both macos and
windows, its name is PWGL a free environment for computer assisted
composition in openGL. (http://www2.siba.fi/PWGL/)
I'm running Ubuntu 8.04 and wine 0.9.59.
I have to say that I also installed vcrun2005 and
2005 Aug 17
2
power of a matrix
Dear all,
I have a population with three age-classes, at time t=0 the population
is:
n.zero <- c(1,0,0)
I have a transition matrix A which denotes "fertility" and "survival":
A <- matrix(c(0,1,5, 0.3,0,0, 0,0.5,0), ncol=3, byrow=TRUE)
To obtain the population at t=1, I calculate:
A %*% n.zero
To obtain the population t=2, I calculate:
A %*% (A %*% n.zero)
... and so
2010 Nov 07
1
How do I order xyplot line points?
I have the following xyplot figure:
http://img577.imageshack.us/img577/686/filesizeresults12000000.png
The data are organized in a matrix file as follows:
Type Elements Chromosome Time
bedGz 12000000 chr1 14.240
bedGz 12000000 chr2 7.949
bedGz 12000000 chr3 5.103
bedGz 12000000 chr4 5.290
bedGz 12000000 chr5 5.161
...
The x-axis labels in the Chromosome column are ordered
2010 Nov 29
1
selecting only corresponding categories from a confusion matrix
Dear R colleagues,
as a result of my calculations regarding the inter-observer-variability
in bronchoscopy, I get a confusion matrix like the following:
0 1 1001 1010 11
0 609 11 54 36 6
1 1 2 6 0 2
10 14 0 0 8 4
100 4 0 0 0 0
1000 23 7 12 10 5
1001 0 0 4 0 0
1010 4 0 0 3 0
1011 1 0 1 0 2
11
2010 Aug 02
1
Multibyte characters in (row) names
I have an array with names which contain multibyte characters. ?When I try to
write the array to a file using write.table and row.names = T I receive an error
message when the first such name is encountered, saying that I have not
specified the option to generate NA instead. ?I really would be satisfied if the
row name in the file were exactly what is displayed when I print the array on
the
2007 Nov 16
1
Efficient way to compute power of a sparse matrix
Dear all,
I would like to compute power of a square non symmetric matrix. This is
a part of a simulation study. Matrices are quite large (e.g., 900 by
900), and contains many 0 (more than 99 %). I have try the function
mtx.exp of the Biodem package:
library(Biodem)
m <- matrix(0, 900, 900)
i <- sample(1:900, 3000, replace = T)
j <- sample(1:900, 3000, replace = T)
for(x in 1:3000)
2010 Apr 30
2
Flattening and unflattening symmetric matrices
Here's an easy question: I'd like to convert a symmetric matrix to a
vector composed of the upper.tri() part of it plus the diagonal, and
convert it back again. What's the best way to achieve this? I'm
wondering if there are some built in functions to do this easily. I
can encode fine:
v <- c(diag(A),A[upper.tri(A)])
but I don't see an easy way to recover A from v
2011 Aug 16
1
how to sort the levels of a table
Dear colleagues,
I have really heavy problems in sorting the results of a table according
to certain features of the levels in the table.
Prerequisites:
It all starts with a fairly simple data set, which stores observations
of 21 observers (horizontally from 1 to 21; 21 is
reference/goldstandard) who diagnosed 42 videos (vertically from 1 to
42). See dump of R-object "input" below in
2005 Feb 18
1
Two-factorial Huynh-Feldt-Test
Hi,
I'm currently working on porting some SAS scripts to R, and hence need
to do the same calculation (and get the same results) as SAS in order to
make the transition easier for users of the script.
In the script, I'm dealing with a two-factorial repeated-measures anova.
I'll try to give you a short overview of the setup:
- two between-cell factors: facBetweenROI (numbering