I was asked privately
> I have been using extensively to
> calculate the relatedness-matrix based on the pedigree for
> our ornamental plants. I was wondering if you could give
> me some advice, for which I would like to thank you in
> advance!
> The output of the relate
> the
> > disk that allows larger things to be done, albeit often much slower. I
> also
> > note that you can remove some things you are not using and hope garbage
> > collection happens soon enough.
> >
> > -Original Message-
> > From: R-help On Beha
De: R-help de part de Eric Berger
Enviat el: dimecres, 12 d’abril de 2023 8:38
Per a: Bert Gunter
A/c: R-help
Tema: Re: [R] Matrix scalar operation that saves memory?
One possibility might be to use Rcpp.
An R matrix is stored in contiguous memory, which can be considered as a
One possibility might be to use Rcpp.
An R matrix is stored in contiguous memory, which can be considered as a
vector.
Define a C++ function which operates on a vector in place, as in the
following:
library(Rcpp)
cppFunction(
'void subtractConst(NumericVector x, double c) {
for ( int i =
I doubt that R's basic matrix capabilities can handle this, but have a look
at the Matrix package, especially if your matrix is some special form.
Bert
On Tue, Apr 11, 2023, 19:21 Shunran Zhang
wrote:
> Hi all,
>
> I am currently working with a quite large matrix that takes 300G of
> memory. My
sday, April 11, 2023 10:21 PM
To: r-help@r-project.org
Subject: [R] Matrix scalar operation that saves memory?
Hi all,
I am currently working with a quite large matrix that takes 300G of
memory. My computer only has 512G of memory. I would need to do a few
arithmetic on it with a scalar value. M
er. I also
note that you can remove some things you are not using and hope garbage
collection happens soon enough.
-Original Message-
From: R-help On Behalf Of Shunran Zhang
Sent: Tuesday, April 11, 2023 10:21 PM
To: r-help@r-project.org
Subject: [R] Matrix scalar operation that saves memo
Hi all,
I am currently working with a quite large matrix that takes 300G of
memory. My computer only has 512G of memory. I would need to do a few
arithmetic on it with a scalar value. My current code looks like this:
mat <- 100 - mat
However such code quickly uses up all of the remaining memor
> Deepayan Sarkar
> on Mon, 19 Apr 2021 09:56:58 +0530 writes:
> On Sat, Apr 17, 2021 at 9:08 PM Martin Maechler
> wrote:
>>
>> > Deepayan Sarkar > on Fri, 16 Apr 2021 11:34:20
>> +0530 writes:
>>
>> > I get what I initially thought was unexpecte
On Sat, Apr 17, 2021 at 9:08 PM Martin Maechler
wrote:
>
> > Deepayan Sarkar
> > on Fri, 16 Apr 2021 11:34:20 +0530 writes:
>
> > I get what I initially thought was unexpected behaviour from:
>
> > x <- tapply(runif(100), sample(5, 100, TRUE), mean)
> > solve(Diagonal(5), x
> Deepayan Sarkar
> on Fri, 16 Apr 2021 11:34:20 +0530 writes:
> I get what I initially thought was unexpected behaviour from:
> x <- tapply(runif(100), sample(5, 100, TRUE), mean)
> solve(Diagonal(5), x)
> # Error: not-yet-implemented method for solve(, ).
> # -
I get what I initially thought was unexpected behaviour from:
x <- tapply(runif(100), sample(5, 100, TRUE), mean)
solve(Diagonal(5), x)
# Error: not-yet-implemented method for solve(, ).
# ->> Ask the package authors to implement the missing feature.
This is because x is a 1-D array, so the ope
(1) m[,1] is the first column of matrix (or dataframe) m.
(2) The first row of matrix or dataframe m is m[1,]
(3) To remove the first row of matrix or dataframe m,
do m <- m[-1,]
On Wed, 3 Jul 2019 at 08:59, Nicola Cecchino wrote:
> Hello,
>
> I am simply trying to remove the [,1] row from
give your a matrix an empty column name.
> tmp <- matrix(1:4, 4, 1, dimnames=list(letters[1:4], NULL))
> tmp
[,1]
a1
b2
c3
d4
> dimnames(tmp)[[1]]
[1] "a" "b" "c" "d"
> dimnames(tmp)[[2]]
NULL
> dimnames(tmp)[[2]] <- ""
> tmp
a 1
b 2
c 3
d 4
On Tue, Jul 2, 2019 at 5:09 PM wrot
Hello,
That is not a row, what you seem to have is an object of class
"matrix" and when it's printed it prints the column names or [,1]
[,2] etc if there aren't any colnames. So your matrix has just one
column and 4 rows with rownames 'date', 'Peeps', 'days', 'worn'.
Hope this helps,
R
Hello,
I am simply trying to remove the [,1] row from a matrix. I tried to
search Google to see if I could find how that is removed, but could
not find a way to do it.
So I have the following:
[,1]
date 2019-7-01
Peeps 5
days 7
worn 9
this is wha
My take would be that there is no reason to specify argument names at all when
calling bdiag, and clearly there is a reason to not do so.
The error seems to arise from using the S3 method is.list, which allows your
final example to work. is.list(a=1) clearly fails to match the x argument, but
i
Hello,
Perhaps not a bug, but interesting because the error only happens when
there is a single named argument.
> m <- matrix(1, 1, 1)
> library(Matrix)
> bdiag(m)
1 x 1 sparse Matrix of class "dgCMatrix"
[1,] 1
> bdiag(a = m)
Error in is.list(...) : supplied argument nam
With on official weight, I second the opinion that the existing behavior is
appropriate and not a bug.
Functions should not "unexpectedly" return factors... a common example are the
read.table family of functions that by default return factors, but the
behaviour is deterministic and controllabl
Hi,
I get the same behavior in R 3.5.2 on macOS.
Others may feel differently, but I am not so sure that this is a bug, as
opposed to perhaps the need to clarify in ?Extract, that the following, which
is found under Atomic vectors:
"The index object i can be numeric, logical, character or empty
Hi All,
I like to report this bug related to matrix subset by rownames when passed
as factors. Now factors are may not be safe to use but then it should
generate a warning message. Since many time we use values returned by some
packages as factor to subset a matrix and which may result in a wrong
> On 17 Jul 2017, at 07:27, Jeremie Juste wrote:
>
>
> Hello,
>
> I have some trouble understanding why !b &&TRUE is TRUE. Do you have an idea?
>
>
>> b <- matrix(c(0,1,1,0,1,0),2)
>
>> !b
> [,1] [,2] [,3]
> [1,] TRUE FALSE FALSE
> [2,] FALSE TRUE TRUE
>> !b &&TRUE
> [1] TRUE
>
Hello,
I have some trouble understanding why !b &&TRUE is TRUE. Do you have an idea?
> b <- matrix(c(0,1,1,0,1,0),2)
> !b
[,1] [,2] [,3]
[1,] TRUE FALSE FALSE
[2,] FALSE TRUE TRUE
> !b &&TRUE
[1] TRUE
Best regards,
Jeremie
__
R-help@r-
Fine, except that you already seen to have a very compact solution if that
really is what you are looking for. What am I missing?
--
Sent from my phone. Please excuse my brevity.
On June 7, 2017 9:16:48 PM PDT, Steven Yen wrote:
>OK Thanks. Your response made me think. Here (the last line) is
OK Thanks. Your response made me think. Here (the last line) is what I need:
set.seed(76543211)
w<-1:10; w
a<-matrix(rpois(20,2),nrow=10); a
t(w*a)%*%a
On 6/8/2017 12:09 PM, Jeff Newmiller wrote:
> Is this a question? You seem to have three possible calculations, have
> already implemented two o
Is this a question? You seem to have three possible calculations, have already
implemented two of them (?) and it is unclear (to me) what you think the right
answer for any of them is supposed to be.
--
Sent from my phone. Please excuse my brevity.
On June 7, 2017 8:50:55 PM PDT, Steven Yen w
I need to have all elements of a matrix multiplied by a weight before
being post-multiplied by itself, as shown in the forst block of codes
below. I can also multiply the matrix by the square root of the weight
and then take the outer product.
Actually, what I need is this. Denote each row of t
mber of column of the
>matrix.
>
>Please let me know if this is not clear.
>
>
>Many thanks
>
>
>
>From: Jeff Newmiller
>Sent: 29 April 2017 10:11 PM
>To: r-help@r-project.org; Bert Gunter; abo dalash; R-help
>Subject: Re: [
Break it down. If you have a scalar value val and you want to know if it is in
a vector vec, using val==vec gets you a logical vector as long as vec. You can
use val %in% vec and you get a logical vector as long as val (e.g. 1). If val
is a vector of, say, length 2, then you will get a length 2
I am not a private (or free!) consultant. Post to the r-help if your
question concerns R.
-- Bert
Bert Gunter
On Sat, Apr 29, 2017 at 8:51 AM, abo dalash wrote:
> Hi dear Bert
>
>
> I'm trying to identify number of rows containing 2 specific values.
>
> I tried : which(mydata == 566,235), but
Slick -- thanks.
On 3/10/2017 1:26 AM, Jeff Newmiller wrote:
test2[ , colnames( test1 ) ] <- test1
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http
test2[ , colnames( test1 ) ] <- test1
--
Sent from my phone. Please excuse my brevity.
On March 9, 2017 6:56:13 PM PST, Evan Cooch wrote:
>Suppose I have the following two matrices, both with same number of
>rows
>(3), but different number of columns (3 in test1, 4 in test2).
>
>test1 <- matrix
Suppose I have the following two matrices, both with same number of rows
(3), but different number of columns (3 in test1, 4 in test2).
test1 <- matrix(c(1,1,0,1,0,-1,-1,-1,0),3,3,byrow=T);
test2 <- matrix( rep( 0, len=12), nrow = 3)
I label the rows and columns of the two matrices as follows:
lson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Gabor
Grothendieck
Sent: Tuesday, March 7, 2017 7:21 AM
To: Peter Thuresson
Cc: R-help@r-project.org
Subject: Re: [R] M
Assuming that the input is x <- 1:4, try this one-liner:
> embed(c(0*x[-1], x, 0*x[-1]), 4)
[,1] [,2] [,3] [,4]
[1,]1000
[2,]2100
[3,]3210
[4,]4321
[5,]0432
[6,]0043
[7,]0004
On Mo
## 1.
## This could be captured into a function
tmp <- matrix(0, 7, 4)
tmp
diag(tmp) <- 1
diag(tmp[-1,]) <- 2
diag(tmp[-(1:2),]) <- 3
diag(tmp[-(1:3),]) <- 4
tmp
## 2.
v <- 1:4
v2 <- c(v, rep(0, length(v)))
## this generates a warning that can safely be ignored (or turned off)
matrix(v2, length(
Effectively you want a circulant matrix but filled by column.
Example input vector and number of columns
x = c(1:8,19:20)
nc = 5
For the result you specifically describe, the following generalises for any
vector and any arbitrary number of columns 'nc', padding with zeros as
necessary.
matrix
Well, of course, I *did* make a dumb error (again!!). Here's the
corrected version:
x <- c(1:5,10:12)
## generate vector of indices by outer and %%
i <- seq_along(x)
nc <- 4 ## number of columns desired
Corrected statement
indx <- (outer(i, rev(i-1),"+") %% length(x)) [,seq_len(nc)] +1
Clever, Don.
Here's a more explicit approach that generalizes (if I haven't made
any dumb errors):
x <- c(1:5,10:12)
## generate vector of indices by outer and %%
i <- seq_along(x)
nc <- 4 ## number of columns desired
## get subscripting indices via outer() and %%
indx <- outer(i,rev(i),"+") %% (
Hello,
Try the following.
proj <- function(x){
n <- length(x)
y <- numeric(n)
z <- rep(c(x, y), times = n)
z <- z[-((length(z) - n + 1):length(z))]
matrix(z, ncol = n)
}
proj(1:4)
proj(1:5)
Hope this helps,
Rui Barradas
Em 06-03-2017 16:18, Peter Thure
How about this:
p0 <- 1:4
matrix( c( rep( c(p0, rep(0, 4)) , times=3) , p0) , 7, 4)
Of course, it would take some effort to generalize it to different lengths for
p0.
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
On 3/6/
Hello,
Is there a function in R which can transform, let say a vector:
c(1:4)
to a matrix where the vector is repeated but "projected" +1 one step down for
every (new) column.
I want the output below from the vector above, like this:
p<-c(1,2,3,4,0,0,0,0,1,2,3,4,0,0,0,0,1,2,3,4,0,0,0,0,1,2,3,4
I've done more searching and found a problem with the data in one of the
matrices that was corrupting the calculation. Data now fixed and problem
is solved. Apologies if anyone wasted time on this.
Ken
On Fri, Jan 27, 2017 at 8:29 AM, Jeff Newmiller
wrote:
> You are asked by the Posting Guide
You are asked by the Posting Guide to provide a reproducible example and to
post in plain text (because HTML gets mangled). I would guess your problem has
nothing to do with multiplication, but without the code there is no way to say
for sure.
--
Sent from my phone. Please excuse my brevity.
Hi all. A question about performance of matrix multiplication.
I have two relatively large matrices:
A is 100x3072, all integers 0-255, not sparse
B is 1016x3072, all integers 0-255, not sparse
The command z<-B %*% t(A) works fine and takes roughly 0.2 seconds . If I
add one row to B, t
> On Jul 16, 2016, at 7:43 PM, Ashta wrote:
>
> HI Denes, Duncan,Michael and all,
>
> Thank you very much for the helpful suggestion. Some of my data sets
> were not square matrix, however, Denes's suggestion,"
> as.data.frame.table() ", handled that one.
>
`as.data.frame.table` should work
HI Denes, Duncan,Michael and all,
Thank you very much for the helpful suggestion. Some of my data sets
were not square matrix, however, Denes's suggestion,"
as.data.frame.table() ", handled that one.
Thank you again.
On Sat, Jul 16, 2016 at 7:27 PM, Dénes Tóth wrote:
>
>
> On 07/17/2016 01:3
On 07/17/2016 01:39 AM, Duncan Murdoch wrote:
On 16/07/2016 6:25 PM, Ashta wrote:
> Hi all,
>
> I have a large square matrix (60 x 60) and found it hard to
> visualize. Is it possible to change it as shown below?
>
> Sample example (3 x 3)
>
> A B C
> A 3 4 5
> B 4 7
I'm not sure what the OP is looking for in the first two columns, but
he does seem to be looking for only the diagonal and super-diagonal
elements. Here's some code that makes output that looks similar to
the "Desired output":
mat1 <- matrix(rbind(c(3, 4, 5),
c(4, 7, 8),
On 16/07/2016 6:25 PM, Ashta wrote:
> Hi all,
>
> I have a large square matrix (60 x 60) and found it hard to
> visualize. Is it possible to change it as shown below?
>
> Sample example (3 x 3)
>
> A B C
> A 3 4 5
> B 4 7 8
> C 5 8 9
>
> Desired output
> A A 3
> A B 4
>
Hi all,
I have a large square matrix (60 x 60) and found it hard to
visualize. Is it possible to change it as shown below?
Sample example (3 x 3)
A B C
A 3 4 5
B 4 7 8
C 5 8 9
Desired output
A A 3
A B 4
A C 5
B B 7
B C 8
C C 9
Thank you in advance
__
z %% 2 == 1
has 12 logical values. What do you expect R to do with it worth respect to 4
rows?
--
Sent from my phone. Please excuse my brevity.
On May 30, 2016 11:38:46 AM PDT, Carl Sutton via R-help
wrote:
>Hi Guru's
>In my quest to understand R I have what I thought was a simple exercise
Hi Guru's
In my quest to understand R I have what I thought was a simple exercise that
now has me baffled. Why the error message after running this code? I am
totally baffled by the error message. I was expecting rows 1 and 3 of the x
matrix to be returned, and have not a clue as to why this
Thank you very much Peter.
On Sat, May 21, 2016 at 9:18 PM, peter dalgaard wrote:
>
> > On 21 May 2016, at 21:00 , george brida wrote:
> >
> > Dear R users:
> >
> > I have written the following lines :
> >
> >> x=c(10,11,12,13,14,17,15,16,10,11,41,25,26,14,12,14,15,20,14,22)
> >> x=matrix(x,nco
I don't know if there is some sort of propagation delay, but the reason has
already been given and multiple fixes suggested.
-pd
> On 21 May 2016, at 21:26 , george brida wrote:
>
> Roy,
>
> Yes, t(y-X %*% b) is the transpose of y-X %*% b. In principle the product
> of t(y-X %*% b) *(y-X %*
Roy,
Yes, t(y-X %*% b) is the transpose of y-X %*% b. In principle the product
of t(y-X %*% b) *(y-X %*% b) is a scalar, I don't know why I have an error
message after the following line:
(t(y-X %*% b)%*%(y-X %*% b)/(length(y)-ncol(X)))*solve(t(X)%*% X)
Thanks
On Sat, May 21, 2016 at 9:10 PM,
> On 21 May 2016, at 21:00 , george brida wrote:
>
> Dear R users:
>
> I have written the following lines :
>
>> x=c(10,11,12,13,14,17,15,16,10,11,41,25,26,14,12,14,15,20,14,22)
>> x=matrix(x,ncol=2)
>> a=matrix(1,nrow(x),1)
>> X=cbind(a,x)
>> y=c(12.00, 11.00, 13.00, 12.50, 14.00, 18.50, 15.0
> str(t(y-X %*% b))
num [1, 1:10] 0.595 -1.7538 -0.0498 -1.651 -0.6328 ...
> str((y-X %*% b))
num [1:10, 1] 0.595 -1.7538 -0.0498 -1.651 -0.6328 …
-Roy
> On May 21, 2016, at 12:00 PM, george brida wrote:
>
> Dear R users:
>
> I have written the following lines :
>
>> x=c(10,11,12,13,14,17
Dear R users:
I have written the following lines :
>x=c(10,11,12,13,14,17,15,16,10,11,41,25,26,14,12,14,15,20,14,22)
> x=matrix(x,ncol=2)
> a=matrix(1,nrow(x),1)
> X=cbind(a,x)
>y=c(12.00, 11.00, 13.00, 12.50, 14.00, 18.50, 15.00, 12.50, 13.75, 15.00)
>b=solve(t(X)%*% X)%*% t(X)%*% y
when I wro
On Wed, Apr 20, 2016 at 1:25 AM, Martin Maechler
wrote:
>> Henrik Bengtsson
>> on Tue, 19 Apr 2016 14:04:11 -0700 writes:
>
> > Using the Matrix package, how can I create a row-oriented sparse
> > Matrix from scratch populated with some data? By default a
> > column-orien
> Henrik Bengtsson
> on Tue, 19 Apr 2016 14:04:11 -0700 writes:
> Using the Matrix package, how can I create a row-oriented sparse
> Matrix from scratch populated with some data? By default a
> column-oriented one is created and I'm aware of the note that the
> packag
Using the Matrix package, how can I create a row-oriented sparse
Matrix from scratch populated with some data? By default a
column-oriented one is created and I'm aware of the note that the
package is optimized for column-oriented ones, but I'm only interested
in using it for holding my sparse row
Hi,
I am looking for an implementation of the fused lasso that allows the
predictor matrix to be an "abstract" linear operator, namely the cumulative
sum (that is, (X.b)_i = sum(b_k, k=1..i)) (due to the size of the problem,
forming the entire matrix is unlikely to be a good approach). Any pointer
Yes, but colMeans, rowMeans, pmax, pmin , etc. are *much* faster.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Fri, Feb 12, 2016 at 9:15 PM, J
Hi Ashta,
Surely you are aware of the "apply" family of functions that return the
numbers you want:
ashmat<-matrix(c(117,12,13,21,21,32,11,1,65,43,23,7,58,61,78,95 ),
nrow=4,byrow=TRUE)
apply(ashmat,2,mean)
[1] 65.25 37.00 31.25 31.00
apply(ashmat,1,which.max)
[1] 1 2 1 4
Jim
On Sat, Feb 13, 2
hi all,
I have a square matrix (1000 by 1000),
1. I want calculate mean, min and max values for each column and row.
2, I want pick the coordinate value of the matrix that has the max
and min value for each row and column.
This an example 4 by 4 square matrix
TEO
> Sent: Monday, January 25, 2016 9:53 AM
> To: r-help@r-project.org
> Subject: [R] Matrix of Lists containing numbers and characters
>
> Here is my sample code
>
> TunePar<-matrix(list(Null),2,2)
>
> TunePar[[1,1]]=list(subclasses=3,model="gen.ridge")
&g
Here is my sample code
TunePar<-matrix(list(Null),2,2)
TunePar[[1,1]]=list(subclasses=3,model="gen.ridge")
tune=paste(colnames(Temp),Temp,sep="=")
tune=paste(tune,collapse=",")
However when I type tune
This is what I get
"subclasses=3,model=1"
The text "gen.ridge has been converted to the
Da: Paul Gilbert [pgilbert...@gmail.com]
Inviato: martedì 15 dicembre 2015 15.28
A: Stefano Sofia
Cc: r-help@r-project.org; Fox, John; peter dalgaard
Oggetto: Re: [R] matrix which results singular but at the same time positive
definite
Stefano
I think in other response to in this thread you got
Stefano
I think in other response to in this thread you got the answer to the
question you asked, but you may be asking the wrong question. I'm not
familiar with the specific papers you mention and you have not provided
enough detail about what you are doing, so I am guessing a bit. The term
-project.org
Oggetto: RE: [R] matrix which results singular but at the same time positive
definite
Dear Peter,
> -Original Message-
> From: peter dalgaard [mailto:pda...@gmail.com]
> Sent: Thursday, December 10, 2015 11:09 AM
> To: Stefano Sofia
> Cc: Fox, John; r-help@r-projec
Dear Peter,
> -Original Message-
> From: peter dalgaard [mailto:pda...@gmail.com]
> Sent: Thursday, December 10, 2015 11:09 AM
> To: Stefano Sofia
> Cc: Fox, John; r-help@r-project.org
> Subject: Re: [R] matrix which results singular but at the same time
> positiv
--
> John Fox, Professor
> McMaster University
> Hamilton, Ontario
> Canada L8S 4M4
> Web: socserv.mcmaster.ca/jfox
>
>
>
>
>> -----Original Message-
>> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Stefano Sofia
>> Sent: December
he data on these scales?
>
> Best,
> John
>
> -
> John Fox, Professor
> McMaster University
> Hamilton, Ontario
> Canada L8S 4M4
> Web: socserv.mcmaster.ca/jfox
>
>
>
>
> > -Original Message-
> > From: R-help [mailto:r-hel
Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Stefano Sofia
> Sent: December 10, 2015 5:08 AM
> To: r-help@r-project.org
> Subject: [R] matrix which results singular but at the same time positive
> definite
>
> Dear list users,
> through th
ofessor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
Web: socserv.mcmaster.ca/jfox
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Stefano Sofia
> Sent: December 10, 2015 5:08 AM
> To: r-help@r-project.org
> Subject: [R] matrix wh
On 10/12/15 23:08, Stefano Sofia wrote:
Dear list users,
through the "matrixcalc" package I am performing some checks of variance
matrices (which must be positive definite).
In this example, it happens that the matrix A here reported is singular but
positive definite. Is it possible?
Decrease the "tol" parameter specified into the "is.non.singular.matrix() call,
for example as:
m <- matrix(c( 1.904255e-12, -1.904255e-12, -8.238960e-13, -1.240294e-12,
-1.904255e-12, 3.637979e-12, 1.364242e-12, 1.818989e-12,
-8.238960e-13, 1.364242e-12, 4.80998
Dear list users,
through the "matrixcalc" package I am performing some checks of variance
matrices (which must be positive definite).
In this example, it happens that the matrix A here reported is singular but
positive definite. Is it possible?
[,1] [,2] [,3]
On Sep 29, 2015, at 4:49 PM, waddawanna wrote:
> Hello Steven,
>
> It looks like, there is no in-built function that can do GAUSS ".*"
> element-wise multiplication.
> Now, if you want to make the desired computations in R, it is actually
> preatty straightforward.
>
>> a<-c(1,2,3)
>> b<-matrix
On 30/09/15 12:49, waddawanna wrote:
Hello Steven,
It looks like, there is no in-built function that can do GAUSS ".*"
element-wise multiplication.
Now, if you want to make the desired computations in R, it is actually
preatty straightforward.
a<-c(1,2,3)
b<-matrix(rep(1:9,1),3,3,byrow=TRUE)
a
Yes it is obvious --- once someone else pointed it out.
Thanks for the hint.
Terry T.
On 07/16/2015 12:52 PM, Peter Langfelder wrote:
Hi Terry,
maybe I'm missing something, but why not define a matrix BB = V'B;
then t(B) %*% V = t(BB), then your problem reduces to finding A such
that t(BB) %*
Hi Terry,
maybe I'm missing something, but why not define a matrix BB = V'B;
then t(B) %*% V = t(BB), then your problem reduces to finding A such
that t(BB) %*% A = 0?
Peter
On Thu, Jul 16, 2015 at 10:28 AM, Therneau, Terry M., Ph.D.
wrote:
> This is as much a mathematics as an R question, in t
This is as much a mathematics as an R question, in the "this should be easy but I don't
see it" category.
Assume I have a full rank p by p matrix V (aside: V = (X'X)^{-1} for a particular setup),
a p by k matrix B, and I want to complete an orthagonal basis for the space with distance
functio
> On Jul 4, 2015, at 3:09 AM, Alex Kim wrote:
>
> Hi guys,
>
> Suppose I have an extremely large data frame with 2 columns and .5 mil
> rows. For example, the last 6 rows may look like this:
> .
> ..
> ...
> 89 100
> 93 120
> 95 125
> 101NA
> 115NA
> 123
Hi guys,
Suppose I have an extremely large data frame with 2 columns and .5 mil
rows. For example, the last 6 rows may look like this:
.
..
...
89 100
93 120
95 125
101NA
115NA
123NA
124NA
I would like to manipulate this data frame to output
Hi guys,
Suppose I have an extremely large data frame with 2 columns and .5 mil
rows. For example, the last 6 rows may look like this:
.
..
...
89 100
93 120
95 125
101NA
115NA
123NA
124NA
I would like to manipulate this data frame to output
Hi guys,
Suppose I have an extremely large data frame with 2 columns and .5 mil
rows. For example, the last 6 rows may look like this:
.
..
...
89 100
93 120
95 125
101NA
115NA
123NA
124NA
I would like to manipulate this data frame to output
Well 'list' in R is pretty naturally the same as R's 'atomic vector' in
scads of languages. In R the term needs special care since it's still a
'vector'.
'Degenerate dimension' is probably a helpful phrase for understanding what
is happening here.
Cheers, Mike
On Saturday, July 4, 2015, Rolf Tur
Hi,
On Fri, Jul 3, 2015 at 10:33 AM, Zander, Joscha
wrote:
> Good day R-community,
>
> i just wondered if it is a bug or a feature...
>
> When i have a matrix "mat" with one column and i delete the last row with
>
> mat <- mat[-nrow(mat),] the result is a list.
I have no idea how you're getting
> On Jul 3, 2015, at 9:33 AM, Zander, Joscha wrote:
>
> Good day R-community,
>
> i just wondered if it is a bug or a feature...
>
> When i have a matrix "mat" with one column and i delete the last row with
>
> mat <- mat[-nrow(mat),] the result is a list.
>
> So my next call mat[10,] will t
Good day R-community,
i just wondered if it is a bug or a feature...
When i have a matrix "mat" with one column and i delete the last row with
mat <- mat[-nrow(mat),] the result is a list.
So my next call mat[10,] will throw an "wrong dimension" error.
The proper call must be:
mat <- as.matrix
Thank you very much. It worked!
On Sun, Jun 14, 2015 at 8:00 PM, jim holtman wrote:
> Is this what you want:
>
>> x1 = structure(list(Subject = c("x1", "x2"), A = c(1.5, -1.2), B = c(-1.3,
> + -0.3), C = c(0.4, 0.3), D = c(-0.2, -0.1)), .Names = c("Subject",
> + "A", "B", "C", "D"), class = "dat
Is this what you want:
> x1 = structure(list(Subject = c("x1", "x2"), A = c(1.5, -1.2), B = c(-1.3,
+ -0.3), C = c(0.4, 0.3), D = c(-0.2, -0.1)), .Names = c("Subject",
+ "A", "B", "C", "D"), class = "data.frame", row.names = c(NA,
+ -2L))
>
> x2 = structure(list(Subject = c("x1", "x2"), A = c(4.3,
?merge
Particularly look at the all argument.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
Live: OO#.
Dear group:
I have two data frames. The column names of the two data frame has
some common variables but not identical.
my aim is to make 2 DFs more uniform by taking union of both colnames
For example: I have x1 and x2 matrices:
> x1
SubjectAB CD
1 x1 1.5 -1.3 0.4 -0.2
gt; David L Carlson
> Department of Anthropology
> Texas A&M University
> College Station, TX 77840-4352
>
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Sergio
> Fonda
> Sent: Friday, June 5, 2015 8:47 AM
> To: John Kane
> Cc:
nda
Sent: Friday, June 5, 2015 8:47 AM
To: John Kane
Cc: R-help
Subject: Re: [R] Matrix of indexes to extract sparse data in dataframe
Thank you, of course but I can't use that form as I told. My question is
about the possibility to enter in a dataframe with a matrix of indices and
get the cor
oes it.
>
> John Kane
> Kingston ON Canada
>
>
> > -Original Message-
> > From: sergio.fond...@gmail.com
> > Sent: Fri, 5 Jun 2015 15:06:34 +0200
> > To: r-help@r-project.org
> > Subject: [R] Matrix of indexes to extract sparse data in dataframe
d1 <- apply(c0, 1, min) I think does it.
John Kane
Kingston ON Canada
> -Original Message-
> From: sergio.fond...@gmail.com
> Sent: Fri, 5 Jun 2015 15:06:34 +0200
> To: r-help@r-project.org
> Subject: [R] Matrix of indexes to extract sparse data in dataframe
&g
1 - 100 of 926 matches
Mail list logo