similar to: colSum() in Matrix objects

Displaying 20 results from an estimated 1000 matches similar to: "colSum() in Matrix objects"

2007 Jan 26
2
%*% in Matrix objects
Dear R users, I need to normalize a bunch of row vectors. At a certain point I need to divide a matrix by a vector of norms. I find that the behavior of Matrix objects differs from normal matrix objects. Example the following code examples differ only in xnormed changing from normal to Matrix object: x = matrix(1:12,3,4) x = as(x, "CsparseMatrix") xnorms = sqrt(colSums(x^2))
2016 Apr 20
0
Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?
>>>>> Henrik Bengtsson <henrik.bengtsson at gmail.com> >>>>> 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 > package is optimized for
2007 Jun 19
1
Matrix library error: "should never happen; please report"
Hi, I got the following error. Sorry but this time I couldn't reproduce it with a simple chunk of code: .TM.repl.i.2col(): drop 'matrix' case ... Error in .nextMethod(x = x, i = i, j = j) : 'i' has no integer column number should never happen; please report In addition: Warning messages: 1: Ambiguous method selection for "%*%", target
2007 May 15
1
Matrix package: writeMM
Hi, I'm finding that readMM() cannot read a file written with writeMM(). Example: library(Matrix) a = Matrix(c(1,0,3,0,0,5), 10, 10) a = as(a, "CsparseMatrix") writeMM(a, "kk.mm") b = readMM("kk.mm") Error in validObject(.Object) : invalid class "dgTMatrix" object: all row indices must be between 0 and nrow-1 Thoughts? Thanks, -Jose -- Jose
2007 Jan 23
3
[fixed] vectorized nested loop: apply a function that takes two rows
(Extremely sorry, disregard previous email as I hit send before pasting the latest version of the example; this one is smaller too) Dear R users, I want to apply a function that takes two vectors as input to all pairs (combinations (nrow(X), 2))of matrix rows in a matrix. I know that ideally, one should avoid loops in R, but after reading the docs for do.call, apply, etc, I still don't know
2007 Jan 23
3
[fixed] vectorized nested loop: apply a function that takes two rows
(Extremely sorry, disregard previous email as I hit send before pasting the latest version of the example; this one is smaller too) Dear R users, I want to apply a function that takes two vectors as input to all pairs (combinations (nrow(X), 2))of matrix rows in a matrix. I know that ideally, one should avoid loops in R, but after reading the docs for do.call, apply, etc, I still don't know
2016 Apr 19
2
Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?
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-oriented data and doing basic subsetting by rows (even using drop=FALSE). Here is what I
2009 Oct 24
1
operations on sparse matrices, and dense intermediary steps
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I'm doing some basic operations on large sparse matrices, for example getting a row. it takes close to 30 seconds on a 3Ghz machine, and shots the memory usage up to the sky. I suspect there are dense intermediary steps (which, if true would defeat the purpose of trying to use sparse representaitons). As much as I try understanding the
2011 Jan 18
1
Semi-Regular Time Series with Missing Values
Hi, I'm trying to make a ts object that has both NA values and a frequency other than 1 (so I can use stl). I've tried all permutations I can think of, but cannot get the desired (expected?) results. The values live in x and the corresponding semi-regular time stamps are in t: > library('zoo') > z = zoo(x, order.by=t, frequency=24) > zzr = as.zooreg(z, start=0) > zr
2007 Dec 03
1
linking C/C++ external libraries.
Hi Everyone, I'm trying to load some C++ code using dyn.load but I'm getting unresolved symbols associated with some external libraries (CSparse). I gather this is something to do with linking as the the code compiles fine. However, I've passed -L/home/jarrod/My_Programs/SuiteSparse/CSparse/Lib -lcsparse to the complier (g++), either directly using R CMD SHLIB or as
2007 Jan 23
0
vectorized nested loop: apply a function that takes two rows
Dear R users, I want to apply a function that takes two vectors as input to all pairs (combinations (nrow(X), 2))of matrix rows in a matrix. I know that ideally, one should avoid loops in R, but after reading the docs for do.call, apply, etc, I still don't know how to write the nested loop in a vectorized way. Example data: x = matrix(rnorm(1000), 100, 100) zeros = runif(90) x[] # this is
2006 Jan 11
2
Problem with making Matrix
Hi R-help citizens, I'm having trouble making version 0.99-6 of Matrix on FreeBSD 6.0. The error message is: * Installing *source* package 'Matrix' ... ** libs gcc -I/usr/local/lib/R/include -I/usr/local/include -D__NO_MATH_INLINES -fPIC -g -O2 -c Csparse.c -o Csparse.o ... numerous lines deleted ... gcc -I/usr/local/lib/R/include -I/usr/local/include -D__NO_MATH_INLINES
2009 Jan 20
1
Creating a Sparse Matrix from a Sparse Vector
Hello, I am working with a sparse matrix that is approx. 13,900 by 14,100. My goal is to select a row out of the matrix and create a new matrix with that row repeated 13,900 times without having to do any looping. Example: Starting Matrix: exampleMatrix 3 x 4 sparse Matrix of class "dgCMatrix" [1,] 1 . . . [2,] . 1 . 0.5 [3,] . . 1 .. New Matrix:.. newExampleMatrix 3 x 4 sparse
2017 Oct 21
1
What exactly is an dgCMatrix-class. There are so many attributes.
> On Oct 21, 2017, at 7:50 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: > >>>>>> C W <tmrsg11 at gmail.com> >>>>>> on Fri, 20 Oct 2017 15:51:16 -0400 writes: > >> Thank you for your responses. I guess I don't feel >> alone. I don't find the documentation go into any detail. > >> I also find
2007 Aug 02
1
Using 'diff' on zoo vs zooreg classes (possible bug?)
Hello, Can anyone explain the following behaviour? To me it seems a bug, but maybe it is intentional. It seems that a diff on a zooreg class that is not _strictly_ regular only considers those entries that are 'deltat' apart. In the following, diff on the zooreg class only returns values where the index was one second apart. The example replicates by dev code, but I've also tested
2020 Jul 21
3
trivial typo in ?Matrix::sparse.model.matrix.Rd
Hi, Martin, Ben, et al.: On 2020-07-21 04:33, Martin Maechler wrote: >>>>>> Ben Bolker >>>>>> on Mon, 20 Jul 2020 20:11:04 -0400 writes: >> ? "form" -> "from". Diff against latest SVN: >> Index: sparse.model.matrix.Rd >> =================================================================== >> ---
2016 Jan 04
2
R, AIX 64-bit builds - trying to understand root cause for message: "Error: Line starting 'Package: tools ...' is malformed!"
The bulk is on my forums - the final post for today is: Results to date: A. It looks like I am going to need a newer compiler for C - xlc/xlC V11 apparently does not understand this code: "/data/prj/cran/R-3.2.3/src/main/memory.c", line 2149.31: 1506-046 (S) Syntax error. I will have to check if R-devel has different code before asking for assistence. +2139 #ifdef
2013 Feb 05
2
duplicate data
Hello, I have a long list of x-, y- and z-data and try to generate a heatmap. Obviously there are several data with identical x- and y-values. I get the following error message: Error in interp.old(x, y, z, xo = xo, yo = yo, ncp = 0, extrap = extrap, : duplicate data points: need to set 'duplicate = ..' Unfortunately there seems no help screen on "duplicate". I'd prefer
2019 Jan 08
2
File permissions
Hello, I am mosty done with the upgrade, but there is a problem that keeps me awake at night: file ownership and permissions. It would be most helpful to have the following from Aki's live system: ls -halFR /var/run/dovecot -------------- next part -------------- An HTML attachment was scrubbed... URL:
2009 Apr 18
1
Modelling an "incomplete Poisson" distribution ?
Dear list, I have the following problem : I want to model a series of observations of a given hospital activity on various days under various conditions. among my "outcomes" (dependent variables) is the number of patients for which a certain procedure is done. The problem is that, when no relevant patient is hospitalized on said day, there is no observation (for which the "number