Hi,
I have a vector and a list, with data I would like to multiply together.
So for instance I have a vector s:
[[1]]
[1] 44308
[[2]]
[1] 4371
Also, I have a list d:
[[1]]
[1] 1201 6170 2036 2927 1625 1391 2074 1453 3172 3027 4691 3719 1185 320 2071
1027 1046 1186 1403 580 1382 4408
On 20/08/2008, at 10:08 AM, Altaweel, Mark R. wrote:
Hi,
I have a vector and a list, with data I would like to multiply
together.
No you haven't. You have two ***lists***. Lists and vectors
are not the same thing. If you don't distinguish between them
you will
needed to multiply N pairs of
numbers.
--- On Mon, 18/8/08, Jeff Laake [EMAIL PROTECTED] wrote:
From: Jeff Laake [EMAIL PROTECTED]
Subject: [R] matrix row product and cumulative product
To: r-help@r-project.org
Received: Monday, 18 August, 2008, 12:49 PM
I spent a lot of time searching
Thanks for the tips on inline, jit and Reduce. The latter was exactly
what I wanted although the loop
is still the fastest for the simple product (accumulate=TRUE for
reduce). With regards to Moshe's comment,
I was just surprised by the timing difference. I tend to use apply
without giving
Sorry a correction to my last posting. I had accumulate switched
between prod and cumprod and I had also forgotten to included time for
conversion from list back to matrix for cumprod. Now as Chuck stated
the results for Reduce are about the same or worse than a loop.
regards--jeff
I spent a lot of time searching and came up empty handed on the
following query. Is there an equivalent to rowSums that does product or
cumulative product and avoids use of apply or looping? I found a rowProd
in a package but it was a convenience function for apply. As part of a
likelihood
On Sun, 17 Aug 2008, Jeff Laake wrote:
I spent a lot of time searching and came up empty handed on the following
query. Is there an equivalent to rowSums that does product or cumulative
product and avoids use of apply or looping? I found a rowProd in a package
but it was a convenience
:42 PM
To: Zhang Yanwei - Princeton-MRAm; r-help@r-project.org
Subject: RE: [R] Matrix multiplication
Hi,
Yes. this is a way, and relatively easy ... Using Reduce. Note: in order to
use Reduce, you need an update-to-date version of R. I'm using 2.6.2.
First you have to have all the matrices line
-5.834807
### end demo ###
So, they are the same. Cheers!
-gary
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Zhang Yanwei - Princeton-MRAm
Sent: Wednesday, August 06, 2008 5:02 PM
To: r-help@r-project.org
Subject: [R] Matrix multiplication
Hi all
Hi,
as a bloody R beginner I failed to solve the probably simple problem
to create a barplot of the following data read from a file
Year A BC
2000 4 30
2001 2 13
2002 1 25
The Barplot should look like
5 |
On Fri, 25 Jul 2008, Nutter, Benjamin wrote:
data - data.frame(Year=c(2000,2001,2002),
A=c(4,2,1),
B=c(3,1,2),
C=c(0,3,5))
data.mat - as.matrix(data)[,2:4]
rownames(data.mat) - data$Year
data.mat - t(data.mat)
As a beginner also try downloading the rattle GUI , with all dependecies
=true , or R Cmdr GUI..
these are both packages
go to rattle.togaware.com for the rattle instructions and installations
.its very very user friendly even though the purists think its infra
dig.(kidding- Friday humour)
On Fri, 25 Jul 2008, Jim Lemon wrote:
library(plotrix)
Well, if I try this in the example of the previous poster I get
nicely rendered fonts - which is the only difference I noticed.
# barp groups data in columns, not rows, so transpose
barp(t(atdat[,2:4]),names.arg=atdat[,1],col=2:4)
,beside=TRUE)
As I said this works great - but now I would like to use the table
heading as legend - and have no idea how to access the header (see below)
-Original Message-
On Behalf Of Andreas Tille
Sent: Friday, July 25, 2008 8:14 AM
To: r-help@r-project.org
Subject: [R] Matrix barplot
This gets you close to what you want. The 31/33 are row names that
you can extract and store as actual columns,
x - list('1995'=list('31'=1, '33'=2), '2006'=list('31'=3, '33'=4))
y - lapply(names(x), function(.L1){
+ cbind(as.numeric(.L1),do.call(rbind, x[[.L1]]))
+ })
(z - do.call(rbind,
Hi Murali,
So, the solution to your problem will be to explicitly convert your
matrix to a numeric matrix. Maybe matrix (?matrix) will do, or you'll
also have to use as.numeric (?as.numeric).
The strings on the left seem to me to be the row labels, right..?, not
elements in the matrix/table.
As
it exists).
-Original Message-
From: [EMAIL PROTECTED] on behalf of Duncan Murdoch
Sent: Fri 7/18/2008 1:00 AM
To: Murali K
Cc: r-help@r-project.org
Subject: Re: [R] matrix multiplication question
On 17/07/2008 9:47 PM, Murali K wrote:
Hello,
I am a newcomer to R and therefore
Hello,
I am a newcomer to R and therefore apologize for posting such a
basic question. I am
trying to multiply 2 matrices t(X1)%*%X1, where t(X1) is:
1 2 3 4 5 8 12 13 20 24 26 27 31 33 34 36 37 40 41 42 45 46
47 48 49
ones 1 1 1 1 1 1 1 1 1 11 1 1
On 17/07/2008 9:47 PM, Murali K wrote:
Hello,
I am a newcomer to R and therefore apologize for posting such a
basic question. I am
trying to multiply 2 matrices t(X1)%*%X1, where t(X1) is:
It's hard to say for sure, but it looks as though X1 really isn't a
numeric matrix. The ones
the following code:
m-matrix(nrow=10,ncol=10)
i-1001
mx-trunc(i/1000)
my-(i/1000-mx)*1000
m[mx,my]-1
does not assign the value at the matrix m[1,1]
Any hints?
Thanks
v
--
View this message in context:
http://www.nabble.com/Matrix-set-value-problem-tp18253809p18253809.html
Sent from the R
-project.org
Onderwerp: [R] Matrix set value problem
the following code:
m-matrix(nrow=10,ncol=10)
i-1001
mx-trunc(i/1000)
my-(i/1000-mx)*1000
m[mx,my]-1
does not assign the value at the matrix m[1,1]
Any hints?
Thanks
v
--
View this message in context:
http://www.nabble.com/Matrix-set-value
Hi,
when you do the trunc the mx is not a real integer 1 so you must round up
m-matrix(data=NA, nrow=10,ncol=10)
i-1001
mx-round(trunc(i/1000))
my-round((i/1000-mx)*1000)
m[mx,my]-1
m
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]1 NA NA NA NA NA NA NA NA
Hello everyone,I am having a difficult time understanding what commands
are used to add and remove elements froma matrix or data frame.For ex
ample if I want to remove element=[1,50] or elements [1,50:63] or elements
[2:4,20:35]from a matrix and replace with NA or any number what command
must
Read the help page or better the manuals! And before posting, please
read the posting guide.
You get the help page for indexing by, e.g.:
help([)
Uwe Ligges
Paul Adams wrote:
Hello everyone,I am having a difficult time understanding what commands
are used to add and remove elements
ng,
I have a matrix (x) with binary content. Each row of the matrix holds exactly
one 1, and the rest of the row is zeros. The thing is that I need to 'collapse'
the matrix to one column where each row holds the original column index of the
1's (y). Sometimes, the matrix is quite large, so I
: [R] Matrix transformation problem
ng,
I have a matrix (x) with binary content. Each row of the matrix
holds exactly one 1, and the rest of the row is zeros. The thing is
that I need to 'collapse' the matrix to one column where each row
holds the original column index of the 1's (y
11, 2008 10:10 AM
Subject: [R] Matrix transformation problem
ng,
I have a matrix (x) with binary content. Each row of the matrix
holds exactly one 1, and the rest of the row is zeros. The thing is
that I need to 'collapse' the matrix to one column where each row
holds the original column
you may try a matrix multiplication, which has a very high performance in R
x%*%1:ncol(x)
hth.
[EMAIL PROTECTED] schrieb:
ng,
I have a matrix (x) with binary content. Each row of the matrix holds exactly
one 1, and the rest of the row is zeros. The thing is that I need to 'collapse'
the
, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
http://www.student.kuleuven.be/~m0390867/dimitris.htm
- Original Message -
From: [EMAIL PROTECTED]
To: r-help@r-project.org
Sent: Wednesday, June 11, 2008 10:10 AM
Subject: [R
stefan.petersson wrote:
ng,
I have a matrix (x) with binary content. Each row of the matrix holds
exactly one 1, and the rest of the row is zeros. The thing is that I need
to 'collapse' the matrix to one column where each row holds the original
column index of the 1's (y). Sometimes,
Dear R-Users,
Is there a way to create a matrix of data frames in R ?
I am pulling in data frames from a SQL database into R using RODBC. I
would like to pull in a sequence of data frames which are indexed across
two dimensions, and store each data frame as an element in a matrix.
I did try
On Thu, Jun 5, 2008 at 4:22 PM, [EMAIL PROTECTED] wrote:
Dear R-Users,
Is there a way to create a matrix of data frames in R ?
Using builtin BOD and women:
m - matrix(list(BOD, women, women, BOD), 2)
m[[1,2]] # women
height weight
1 58115
2 59117
3 60120
4
it is
not obvious what to return without giving extra information, it is better to
require the extra information through other functions.
From: [EMAIL PROTECTED] on behalf of Olivier Lefevre
Sent: Sat 4/26/2008 9:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [R] matrix
giving extra information, it is better to
require the extra information through other functions.
From: [EMAIL PROTECTED] on behalf of Olivier Lefevre
Sent: Sat 4/26/2008 9:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [R] matrix from list
Olivier Lefevre wrote
It's true one may have to set some rules but I think you are blowing it up.
First, it is true one would have to agree for list[[vec]] to always return
a matrix but it is the useful behaviour since you can already get a vector
with unlist(list[vec]).
Second, as to the raggedness, matrix(),
OL == Olivier Lefevre [EMAIL PROTECTED]
on Sat, 26 Apr 2008 01:31:16 +0200 writes:
OL Greg Snow wrote:
The '[[' only returns a single element from a data structure
OL I know but that is precisely what I find arbitrary.
OL Anyway you are right that it would still return
Olivier Lefevre wrote:
Anyway you are right that it would still return the kind of object, only
subsetted, which is not I want.
I mean [] would do that; I know [[]] doesn't. Yet I still don't see why one
accepts vector arguments but not the other: they are both indexing
operators. It is such
Martin Maechler wrote:
The difference to as.matrix() is that data.matrix() also
produces a numeric matrix in the case the data frame contains
factors.
Thanks, that is useful but it is becoming a little rococo: so may ways to
do this. Also, what if I have a list, not a data frame?
.
From: [EMAIL PROTECTED] on behalf of Olivier Lefevre
Sent: Sat 4/26/2008 9:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [R] matrix from list
Olivier Lefevre wrote:
Anyway you are right that it would still return the kind of object, only
subsetted, which is not I
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Olivier Lefevre
Sent: Thursday, April 24, 2008 4:16 PM
To: [EMAIL PROTECTED]
Subject: Re: [R] matrix from list
Yes, unlist is the magic wand I was looking for. Thanks a million!
Having said
Greg Snow wrote:
The '[[' only returns a single element from a data structure
I know but that is precisely what I find arbitrary.
Anyway you are right that it would still return the kind of object, only
subsetted, which is not I want. As someone kindly pointed out to me
offline, besides the
Another possibly simple thing that I cannot get right is how to extract the
data part of a list as a matrix. The data were read from xls, with labels,
and thus are of list mode, e.g.,
col1 col2
1 0.1 1.1
2 0.2 1.2
I want to extract from that just the numeric data part, i.e., (in this
Hi Olivier,
is this what you want?
x=col1 col2
1 0.1 1.1
2 0.2 1.2
m=read.table(textConnection(x),header=TRUE)
m1=matrix(unlist(m),ncol=2)
m1
[,1] [,2]
[1,] 0.1 1.1
[2,] 0.2 1.2
HTH,
Jorge
On Thu, Apr 24, 2008 at 6:02 PM, Olivier Lefevre [EMAIL PROTECTED] wrote:
Another possibly
Yes, unlist is the magic wand I was looking for. Thanks a million!
Having said that, I find it rather arbitrary that you can write mat[1:4]
but not list[[1:2]]; IMO there should be no need for a magic operator
like unlist: list[[1:length(list)]] could do the job.
-- O.L.
Hi Everyone,
I am running into a problem with matrices. I use R version 2.4.1 and
an older version.
The problem is this:
m-matrix(ncol=3,nrow=4)
m[,1:3]-runif(n=4)
That does what I expect; it fills up the rows of the matrix with the
data vector
m
[,1] [,2] [,3]
[1,]
On 4/21/2008 5:54 AM, William Simpson wrote:
Hi Everyone,
I am running into a problem with matrices. I use R version 2.4.1 and
an older version.
The problem is this:
m-matrix(ncol=3,nrow=4)
m[,1:3]-runif(n=4)
That does what I expect; it fills up the rows of the matrix with the
data
On 21/04/2008, at 9:54 PM, William Simpson wrote:
Hi Everyone,
I am running into a problem with matrices. I use R version 2.4.1 and
an older version.
The problem is this:
m-matrix(ncol=3,nrow=4)
m[,1:3]-runif(n=4)
That does what I expect; it fills up the rows of the matrix with the
Thanks very much Petr and Rold for your helpful replies.
Cheers
Bill
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented,
Hi
Does anyone know how I might pick out diagonal elements of a matrix using a
vector?
If I create a matrix a:
a - matrix(c(1:16), 4, byrow=TRUE)
and I want to pick out the elements (1,1),(2,2),(3,3), or another arbitrary
diagonal (upper or lower), is there any way I can use a vector to do
On 4/12/2008 5:56 AM, Rory Winston wrote:
Hi
Does anyone know how I might pick out diagonal elements of a matrix using a
vector?
If I create a matrix a:
a - matrix(c(1:16), 4, byrow=TRUE)
and I want to pick out the elements (1,1),(2,2),(3,3), or another arbitrary
diagonal (upper or
On Sat, 2008-04-12 at 10:56 +0100, Rory Winston wrote:
Hi
Does anyone know how I might pick out diagonal elements of a matrix using a
vector?
If I create a matrix a:
a - matrix(c(1:16), 4, byrow=TRUE)
Not sure if this does all that you describe below, but:
diag(a)
and you can subset
Rory Winston wrote:
Hi
Does anyone know how I might pick out diagonal elements of a matrix using a
vector?
If I create a matrix a:
a - matrix(c(1:16), 4, byrow=TRUE)
and I want to pick out the elements (1,1),(2,2),(3,3), or another arbitrary
diagonal (upper or lower), is there any way I
Hello,
I am trying to preform a comparative analysis using the partial mantel
method. However, i am having trouble creating compatible matrices. I can
create matrices from my numerical data using the 'distance(x, method)'
function from ecodist, but the row/column names are out put as numbers.
Hello
I've stumbled upon a problem for inversion of a matrix with large values,
and I haven't found a solution yet... I wondered if someone could give a
hand. (It is about automatic optimisation of a calibration process, which
involves the inverse of the information matrix)
code:
On 3/5/2008 8:21 AM, gerardus vanneste wrote:
Hello
I've stumbled upon a problem for inversion of a matrix with large values,
and I haven't found a solution yet... I wondered if someone could give a
hand. (It is about automatic optimisation of a calibration process, which
involves the
Sorry, I meant to send this to the whole list.
On Mar 5, 2008, at 8:46 AM, Charilaos Skiadas wrote:
The problem doesn't necessarily have to do with the range of data.
At first level, it has to do with the simple fact that dfdb has
rank 6 at most, (7 at most in general, though in your case
On Wed, Mar 5, 2008 at 7:43 AM, Duncan Murdoch [EMAIL PROTECTED] wrote:
On 3/5/2008 8:21 AM, gerardus vanneste wrote:
Hello
I've stumbled upon a problem for inversion of a matrix with large values,
and I haven't found a solution yet...
Someone with experience in numerical linear
Matt, I know you are probably busy with work, but I cannot help buy asking
you these R questions. If it is bothersome, please let me know and I will
stick with the R help... but
I have two matrices
X
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 660 693.00 726.0 759.00 792.0 825.00
[2,]
Howdy,
I am trying to invert a matrix for the purposes of least squares. I
have tried a number of things, and the variety of results has me
confused.
1. When I try solve() I get the following:
Error in solve.default(t(X) %*% X) : system is computationally
singular: reciprocal condition number =
Ben Domingue asks:
I am trying to invert a matrix for the purposes of least squares. I
have tried a number of things, and the variety of results has me
confused.
Don't be.
1. When I try solve() I get the following:
Error in solve.default(t(X) %*% X) : system is computationally
singular:
John Kane [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]:
You are trying to create a matrix in the loop
Try creating the matrix before the loop
m - 1:5
n-1:10
y - matrix(rep(NA, 50), nrow=m)
# I think that this might actually work:
y - matrix(rep(NA, 50), nrow=max(m))
for(i in
You are trying to create a matrix in the loop
Try creating the matrix before the loop
m - 1:5
n-1:10
y - matrix(rep(NA, 50), nrow=m)
for(i in 1:length(m))
{ for(j in 1:length(n))
{
y[i,j]=sum(i,j)
}
}
However as Jim Holtman points out you can do this
particular matrix by
What exactly are you intending the loop to do? Why do you have the
'as.matrix' in the middle of the loop? Where was 'y' defined? Does
this do what you want?
outer(1:5, 1:10, +)
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]23456789 1011
GS == Gavin Simpson [EMAIL PROTECTED]
on Tue, 29 Jan 2008 00:09:05 + writes:
GS hits=-2.6 tests=BAYES_00
GS X-USF-Spam-Flag: NO
GS On Mon, 2008-01-28 at 12:17 -0700, Michelle DePrenger-Levin wrote:
I was asked for the following information and hope it might help those
hits=-2.6 tests=BAYES_00
X-USF-Spam-Flag: NO
Hi Michelle,
You don't show your read.csv or read.table call, nor the output of
str(obj) where obj is the name of the object you read the data into.
I notice that you have explicit 0 and NA. Is there a chance that you
have entered NA into the cells
Hello,
I am trying to create multiple matrices (to run a PVA) but can't import all
of them from a .csv without the numbers treated as labels and not factors.
I can enter the matrix slowly:
Site05_96 - matrix(c(0.07,0,0.03,0.00,NA,0.00,
0.09,0.16667,0.31,0.42,NA,0.00,
I was asked for the following information and hope it might help those who
could answer my question...
To import the table I used:
AsMi05test=read.csv(C:/AsMi_Site05_1998.csv)
str(AsMi05test)
`data.frame': 12 obs. of 8 variables:
$ X : Factor w/ 6 levels
hits=-2.6 tests=BAYES_00
X-USF-Spam-Flag: NO
On Mon, 2008-01-28 at 12:17 -0700, Michelle DePrenger-Levin wrote:
I was asked for the following information and hope it might help those who
could answer my question...
That looks fine to me Michelle.
You will have problems with as.matrix on this
Brant Inman wrote:
R-helpers:
I am experiencing some odd behavior with the 'matrix' function that I have
not experienced before and was wondering if there is something that I was
missing in my code.
-
sessionInfo()
R version 2.6.1 (2007-11-26)
On Sun, 20 Jan 2008, Brant Inman wrote:
Note the problems in rows 15, 21, 37 and 43. They should read [0.5, 45.5],
[14.5, 21.5], etc... The matrix function seems to be rounding the second
column up to the next integer. Why would this occur? Can I do something to
prevent this?
I would
R-helpers:
I am experiencing some odd behavior with the 'matrix' function that I have
not experienced before and was wondering if there is something that I was
missing in my code.
-
sessionInfo()
R version 2.6.1 (2007-11-26)
i386-pc-mingw32
locale:
Check your getOption(digits). Default is typically 7. Either you
or a package/function sets it to a small value. You get that
**output** with options(digits=n) where n=1,2,3.
/Henrik
On Jan 20, 2008 7:13 PM, Thomas Lumley [EMAIL PROTECTED] wrote:
On Sun, 20 Jan 2008, Brant Inman wrote:
*As usual, the R-helpers were bang on. Some package must have modified my
digits option without me noticing.*
**
*--*
**
* test - matrix(c(7,47,4,38,20,96,1,14,10,48,2,101,12,161,
+ 1,28,1,19,22,49,25,162,31,200,9,39,22,193,
+ 0.5,45.5,31,131,4,75,31,220,7,55,3,91,14.5,
+
Brant Inman brant.inman at gmail.com writes:
*As usual, the R-helpers were bang on. Some package must have modified my
digits option without me noticing.*
I'm pretty certain that the arm package is the problem.
options(digits)
$digits
[1] 7
library(arm)
Loading required package: MASS
bernardo lagos alvarez blacertain at gmail.com writes:
useR's
I need transform the matrix
wdat
[,1] [,2] [,3] [,4] [,5] [,6]
[1,]010110
[2,]100110
[3,]000011
[4,]110010
[5,]1
useR's
I need transform the matrix
wdat
[,1] [,2] [,3] [,4] [,5] [,6]
[1,]010110
[2,]100110
[3,]000011
[4,]110010
[5,]111100
[6,]001000
to gal
I got the following error:
a = read.csv(mat.csv)
b = as.matrix(a)
tb = t(b)
bb = tb %*% b
dim(bb)
ibb = solve(bb)
bb %*% ibb
ibb = solve(bb)
Error in solve.default(bb) :
system is computationally singular: reciprocal condition number =
1.77573e-19
Are there any ways to find more information
Hello Wang
matrix bb is symmetric positive semidefinite, so
algebraically the eigenvalues are nonnegative.
I would use
bb - crossprod(b)
to calculate bb (faster and possibly more accurate)
Look at eigen(bb,TRUE,TRUE)$values
(see ?eigen for the meaning of the arguments) to see how
many very
Wang Chengbin wrote:
I got the following error:
a = read.csv(mat.csv)
b = as.matrix(a)
tb = t(b)
bb = tb %*% b
dim(bb)
ibb = solve(bb)
bb %*% ibb
ibb = solve(bb)
Error in solve.default(bb) :
system is computationally singular: reciprocal condition number =
1.77573e-19
The basic functions you need are
image()
contour()
although I like better the plot.surface() function in the 'fields' package.
Julian
threshold wrote:
Hi All, simple question:
do you know how to graph the following object/matrix in a 'surface manner':
[,1] [,2] [,3]
Hi All, simple question:
do you know how to graph the following object/matrix in a 'surface manner':
[,1] [,2] [,3][,4] [,5][,6]
[1,] -0.154 -0.065 0.129 0.637 0.780 0.221
[2,] 0.236 0.580 0.448 0.729 0.859 0.475
[3,] 0.401 0.506 0.310 0.650 0.822 0.448
[4,]
On Tuesday 11 December 2007, threshold wrote:
Hi All, simple question:
do you know how to graph the following object/matrix in a 'surface manner':
[,1] [,2] [,3][,4] [,5][,6]
[1,] -0.154 -0.065 0.129 0.637 0.780 0.221
[2,] 0.236 0.580 0.448 0.729 0.859 0.475
Try these:
x - matrix(rnorm(100), ncol=10)
persp(x)
contour(x)
Also, look at the R graph gallery: http://addictedtor.free.fr/graphiques/
-- Tony Plate
threshold wrote:
Hi All, simple question:
do you know how to graph the following object/matrix in a 'surface manner':
Perhaps something like this:
idx - 1:2
lm(as.matrix(iris[idx]) ~., iris[-idx])
Call:
lm(formula = as.matrix(iris[idx]) ~ ., data = iris[-idx])
Coefficients:
Sepal.Length Sepal.Width
(Intercept) 3.682982 3.048497
Petal.Length0.905946 0.154676
You can look at the components of the output using str and pick out
what you want
using $ and attr.
idx - 1:2
z - lm(as.matrix(iris[idx]) ~., iris[-idx])
str(z)
str(summary(z))
On Nov 23, 2007 1:10 PM, Morgan Hough [EMAIL PROTECTED] wrote:
Hi Gabor,
Thanks for your reply. I have it working
Hi there,
I am analyzing a table of brain volume measures where each brain area
(183 of them) is a column with a label and volume values. I have another
table of explanatory variables (age, gender, diagnosis and
IntraCranialVol) that I have been using to model the brain volume
differences. I
Hi Gabor,
Thanks for your reply. I have it working now. A couple of follow-ups if
I may.
I have a shell script parsing the output to find the brain areas where
there is a significant effect of diagnosis but its a bit of a hack. I
was wondering whether there are R specific tools for
Hallo
From a variable x that defines, say, four classes, I would like to define
the matrix mat of dummy variables indicating the classes, i.e.
x - c(1,1,1,1,2,2,2,3,3,3,4,4)
mat - matrix(c(1,0,0,0,
1,0,0,0,
1,0,0,0,
1,0,0,0,
0,1,0,0,
0,1,0,0,
0,1,0,0,
0,0,1,0,
0,0,1,0,
0,0,1,0,
0,0,0,1,
Hello fellow R users,
I have a matrix computation that I imagine should be relatively easy to do,
however I cannot figure out a nice way to do it. I have two matrices, for
example
mat1 - matrix(c(1:5,rep(NA,5), 6:10), nrow=3, byrow=T)
mat2 - matrix(c(2:6, 6:10, rep(NA,5)), nrow=3, byrow=T)
Maybe there is a more elegant solution, but here is one possibility:
mat1[is.na(mat1)]-mat2[is.na(mat1)]
mat2[is.na(mat2)]-mat1[is.na(mat2)]
(mat1+mat2)/2
On Nov 21, 2007 12:30 PM, Gregory Gentlemen [EMAIL PROTECTED] wrote:
Hello fellow R users,
I have a matrix computation that I imagine
On Wed, 2007-11-21 at 14:30 -0500, Gregory Gentlemen wrote:
Hello fellow R users,
I have a matrix computation that I imagine should be relatively easy
to do, however I cannot figure out a nice way to do it. I have two
matrices, for example
mat1 - matrix(c(1:5,rep(NA,5), 6:10), nrow=3,
Dear UseRs,
here is an example scenario presenting my problem:
Multiplying a dsyMatrix with a numeric vector results in an error
(unfortunately in German due to my locale):
(M1 - Matrix( c( 1, 2, 2, 2, 1, 2, 2, 2, 1), nrow = 3))
3 x 3 Matrix of class dsyMatrix
[,1] [,2] [,3]
[1,]1
As the posting guide says:
If you are using an old version of R and think it does not work properly.
upgrade to the latest version and try that, before posting.
This works in current R and current Matrix (0.999375-3)
It also says
If the question relates to a contributed package , e.g.,
use the '-' feature.
mat - matrix(rnorm(100), nrow = 10)
#snip the second row
mat[-2,]
#snip the third column
mat[,-3]
#snip rows 5 and 7
mat[-c(5,7),]
cheers
tc
On 10/23/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi everyone,
suppose I have a 2D matrix, is there a command to snip out
I need some help
I try to install the following package: Matrix_0.999375-2.tar.gz
I have the needed package and R version.
My operating sytem is linux suse 10.1.
I have the following error message
/usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/ld:
ne peut trouver -lgfortran
JMB == Jean Marie Beduin [EMAIL PROTECTED]
on Fri, 05 Oct 2007 09:10:11 +0200 writes:
JMB I need some help
yes
JMB I try to install the following package: Matrix_0.999375-2.tar.gz
JMB I have the needed package and R version.
JMB My operating sytem is linux suse 10.1.
On Thu, Oct 04, 2007 at 06:15:34PM -0500, hadley wickham wrote:
Why would you want a plot that looks like that? Half the bars are
hidden behind other bars!
I would rotate it such that all bars are visible.
-TAG
__
R-help@r-project.org mailing list
On 10/4/07, Todd A. Gibson [EMAIL PROTECTED] wrote:
On Thu, Oct 04, 2007 at 06:15:34PM -0500, hadley wickham wrote:
Why would you want a plot that looks like that? Half the bars are
hidden behind other bars!
I would rotate it such that all bars are visible.
If you are really, really, sure
On Thu, Oct 04, 2007 at 06:15:34PM -0500, hadley wickham wrote:
Why would you want a plot that looks like that? Half the bars are
hidden behind other bars!
I would rotate it such that all bars are visible.
-TAG
-- thus distorting the perspective even more so that you can not make
accurate
check out the 'rgl' package
On 10/4/07, Todd A. Gibson [EMAIL PROTECTED] wrote:
Hello,
Does R have any facility to create a plot that looks similar to this:
http://www.augustcouncil.com/~tgibson/barmatrix.jpg
Thank you,
-TAG
Todd A. Gibson
__
801 - 900 of 903 matches
Mail list logo