search for: thadenjohnj

Displaying 10 results from an estimated 10 matches for "thadenjohnj".

2008 Jul 10
2
Position in a vector of the last value > n
This shouldn't be hard, but it's just not coming to me: Given a vector, e.g., v <- c(20, 134, 45, 20, 24, 500, 20, 20, 20) how can I get the index of the last value in the vector having a value greater than n, in this case, greater than 20? I'm looking for an efficient function I can use on very large matrices, as the FUN argument in the apply() command. Confidentiality
2006 Sep 04
1
Coercing elements of a matrix from integer to double
Ive been converting elements of matrices and arrays, e.g., from Integers to double-precision, by vectorizing the matrix and then remaking it. Alternatively, I can redefine one element as double which then redefines them all. Both methods are quick, so I guess I shouldn't complain, but I would have thought there'd be something more obvious. Have I missed it? Here's my redimensioning
2006 Jul 28
1
order() 'decreasing =' argument must be typed in full
## While in R v. 2.3.1 (the mid-July patch for Windows) ## on a Windows XP machine, this call to order() works fine... order(1:10,decreasing = TRUE) ## [1] 10 9 8 7 6 5 4 3 2 1 ## ...however, the argument name 'decreasing' ## must be typed in toto (note the missing 'g' ## in the following): > order(1:10,decreasin = TRUE) ## Error in order(na.last, decreasing, ...) :
2006 Jul 02
1
sparse matrix tools
Dear R-Help list: I'm using the Matrix library to operate on 600 X ~5000 element unsymmetrical sparse arrays. So far, so good, but if I find I need more speed or functionality, how hard would it be to utilize other sparse matrix toolsets from within R, say MUMPS, PARDISO or UMFPACK, that do not have explicit R interfaces? More information on these is available here
2007 Mar 04
1
Scoping issue?
Hello, The code below is supposed to be a wrapper for matplot to do columnwise visible comparison of several matrices, but I'm doing something wrong because I can't access an argument called 'colnum'. I'd be most grateful for some insight. Thanks, John Thaden Little Rock, AR ################################ # mmatplot is a matplot wrapper to compare the same column of #
2006 Jul 09
1
package:Matrix handling of data with identical indices
In the Matrix package v. 0.995-11 I see that the dgTMatrix Class for compressed, sparse, triplet-form matrices handles Identically indexed data instances by summing their values, e.g., library(Matrix) (Mt <- new("dgTMatrix", i = as.integer(c(0,0,1,1,4)), j = as.integer(c(0,1,2,2,4)), x = as.double(1:5), Dim = as.integer(c(5,5)))) ## 5 x 5 sparse Matrix of class
2006 Jul 09
1
package:Matrix handling of data with identical indices
In the Matrix package v. 0.995-11 I see that the dgTMatrix Class for compressed, sparse, triplet-form matrices handles Identically indexed data instances by summing their values, e.g., library(Matrix) (Mt <- new("dgTMatrix", i = as.integer(c(0,0,1,1,4)), j = as.integer(c(0,1,2,2,4)), x = as.double(1:5), Dim = as.integer(c(5,5)))) ## 5 x 5 sparse Matrix of class
2007 Feb 20
1
baseline fitters
I am pretty pleased with baselines I fit to chromatograms using the runquantile() function in caTools(v1.6) when its probs parameter is set to 0.2 and its k parameter to ~1/20th of n (e.g., k ~ 225 for n ~ 4500, where n is time series length). This ignores occasional low- side outliers, and, after baseline subtraction, I can re-adjust any negative values to zero. But runquantile's
2006 Jul 06
1
Warning while subsetting using Matrix package
Hello, Could someone please explain the following warning while subsetting in the Matrix package? Thanks, John Thaden, PhD U. Arkansas for Med. Sci. Little Rock AR USA > # In the Matrix package... > library("Matrix") > # ...I had previously created a sparse matrix in triplet form: > str(x) Formal class 'dgTMatrix' [package "Matrix"] with 6 slots ..@ i
2008 Oct 07
3
vectorized sub, gsub, grep, etc.
R pattern-matching and replacement functions are vectorized: they can operate on vectors of targets. However, they can only use one pattern and replacement. Here is code to apply a different pattern and replacement for every target. My question: can it be done better? sub2 <- function(pattern, replacement, x) { len <- length(x) if (length(pattern) == 1) pattern <-