Displaying 20 results from an estimated 40000 matches similar to: "Position in a vector of the last value > n"
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
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
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
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 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, ...) :
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
1999 Jun 29
3
S v. 5
Does R, or will R, be integrating the changes to the Chambers/Lucent S
language under their version 5.0? If not already, then when?
John Thaden
Little Rock, Arkansas, USA
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
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 <-
1999 Jun 23
2
coercing factors to matrix() --> num/char ? --
Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk> wrote:
> Martin Maechler <maechler at stat.math.ethz.ch> writes:
[ snip... ]
> > >From this logic, coercing to a matrix should coerce to character rather
> > than integer/numeric codes.
>
> Hm. I'm not sure there really is much logic in this... Factors are
> sometimes character-like, sometimes
1999 Jun 18
1
Stepwise model selection question
I use the step() function occasionally, and I think I understand its
objective, proper use, and limitations. Now I see stepwise model selection
being used in what seems to be an unusual way, and I wonder if it is right
or wrong. May I describe?
Genetic mapping tries to find where in an animal's genome are genetic
elements that influence a particular physical trait. Say there are 100
2007 Mar 11
3
read.table for a subset of data
Hi R-experts,
I have data from four conditions of an experiment. I tried to create four
subsets of the data with read.table, for example,
read.table("Experiment.csv",subset=(condition=="1"))
. I found a similar post in the archive, but the answer to that post was
no. Any new ideas about reading subsets of data with read.table?
Thanks!
Feng
[[alternative HTML version
2009 Apr 21
1
n-dimensional vector operations
Let's start with a concrete case of n=3 dimensions.
Along dimension x, I have a matrix of 5 vectors (each with ten rows)
Along dimension y, I have a matrix of 3 vectors (each with ten rows)
Along dimension z, I have a matrix of 2 vectors (each with ten rows)
I am trying to write a:
function(..., funcp) { }
where funcp(...) is an operator which works on n vectors and returns a
numeric.
2009 Sep 24
1
subsetting from a vector or matrix
I realize this should be simple but I'm having trouble subsetting vectors
and matrices, for example extracting all values meeting a certain
criterion, from a vector. Cannot seem to figure out the correct syntax and
help page not very helpful. Or should I be using some other function than
subset. Thanks for any help.
Jim Bouldin
2012 Aug 28
4
predict.lm(...,type="terms") question
Hello all,
How do I actually use the output of predict.lm(..., type="terms") to
predict new term values from new response values?
I'm a chromatographer trying to use R (2.15.1) for one of the most
common calculations in that business:
- Given several chromatographic peak areas measured for control
samples containing a molecule at known (increasing) concentrations,
first
2010 May 18
5
looking for .. dec if vector if element > x
Hi to all,
I am just looking for more efficient ways ;-)
is there a better way instead a loop to decrease x if greater y
test <- c(1,3,5,7,9)
decrease if greater 1 to
test2 <- c(1,2,4,6,8)
Kind regards
Knut
2010 May 24
2
Data frames, passing by value, and performance
I understand that everything passed to an R function is passed "by
value". This would seem to include data frames, which my current
application uses heavily, both for storing program inputs, and holding
intermediate and final results. In trying to get greater performance
out of my R code, I am wondering if there is any clean way to access
data frames without having them copied all the
2004 Jun 06
3
Average R-squared of model1 to model n
Hi,
We got a question about interpretating R-suqared.
The actual outputs for a test dataset is X=(x1,x2, ..., xn).
model 1 predicted the outputs as Y1=(y11,y12,..., y1n)
model n predicted the outputs as Y2=(y21,y22,..., y2n)
...
model m predicted the outputs as Ym=(ym1,ym2,..., ymn)
Now we have two ways to calculate R squared to evaluate the average performance of committee model.
(a)
2010 Oct 06
1
selected value in a vector to make bold
I wasn't sure about the subject so I am sorry about the vagueness, but if I
have a vector of values, how do I get a certain type of vectors to be bold
or italics?
So let x be a vector from -10 to 10, how would I tell it to bold the x
values that are greater than 0? Or like absolute value of 5? Is it possible
to do this in like an if else statement? Could I use
x<-seq(-10,10,1)
2012 Jan 12
2
scp should not report 100% until the last byte is transferred
Hello,
just my opinion, but yesterday I run into a case, where after 7 hours of
transferring a file (a little bit greater than 1 GB) the scp reported 100% and
after that exited with an error (AIX 7.1):
$ tsocks scp foo user at host:/tmp
...
100% 1101MB 44.2KB/s 448.0KB/s 7:05:38
scp: /tmp/foo: File too large
Probably it should not be rounded up to 100% ?
--
MfG/Sincerely
Toralf F?rster