Displaying 20 results from an estimated 2000 matches similar to: "order() 'decreasing =' argument must be typed in full"
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 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 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 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
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"
2005 Jul 13
2
Kronecker matrix product
Hi
I want to write a little function that takes a matrix X of size
m-by-n, and a list L of length "m", whose elements are matrices all
of which have
the same number of columns but possibly a different number of rows.
I then want to get a sort of dumbed-down kronecker product in which
X[i,j] is replaced by X[i,j]*L[[j]]
where L[[j]] is the j-th of the "m" matrices. For
2006 Feb 18
3
Bug in Sweave? -- scoping problem? (PR#8615)
I have found a strange scoping problem in Sweave. The following Rnw
file doesn't produce the same output in Sweave as it does if I produce
an R file using Stangle and execute that:
\documentclass[12pt]{article}
\begin{document}
<<R>>=
election <- data.frame(A=1:3, B=9:7, C=rep(0,3))
partytotal <- rep(0, ncol(election))
for (i in 1:ncol(election)) {
partytotal[i] <-
2005 Dec 02
3
extracting rows of a dataframe
Hi
look at the following session, in which I have a dataframe,
and I want to extract the second row, without the first column.
Everything works as expected until the last line, where I set
the names of x to NULL, and get a non-desired object (I
want c(4,3).).
Three questions:
(1) why is as.vector(a[2,-1]) not a vector?
(2) How come setting names to NULL gives me bad weirdness?
(3) Can I
2010 Apr 01
2
pdf files in loops
I need to make a bunch of PDF files of histograms. I tried
gatelist = unique(mdf$ArrivalGate)
for( gate in gatelist) {
outfile = paste("../", airport, "/", airport, "taxiHistogram", gate,
".pdf", sep="")
pdf(file = outfile, width = 10, height=8, par(lwd=1))
title=paste("Taxi time for Arrival Gate", gate, "by
2010 Jul 20
1
Call to rgamma using .C causes R to hang
Hi,
I've been trying to get this working for ages, but it causes R to hang.
Here is my C code saved as test1.c
# include <R.h>
# include <Rmath.h>
void test1 (double *x, double *result)
{
result[0] = rgamma(*x, 2.0);
}
This was compiled using R CMD SHLIB test1.c & loaded in R using:
dyn.load("test1.dll")
out <-
2006 Mar 14
1
Internal codes of the factor
Hello!
I am writing some functions and I repeatedly acces internal factor
codes. I figured out that internal codes are 1:n where 1 represents 1st
level, 2 2nd level etc. This is not documented and I wonder if this is
on purpose and subject to change or would be a good idea to add this to
documentation for factor? I can prepair a pacth if this is accepted.
--
Lep pozdrav / With regards,
2006 Apr 17
3
bounding box in PostScript
When a graph is saved as PostScript, the bounding box is often too big.
A consequence is that when the graph is included in a LaTeX document,
the spacing does not look good.
Is this a recognized problem? Is someone working on it? Could I help?
David
2006 Nov 13
1
"stem" does not give a correct answer (PR#9359)
Full_Name: Myung Geun Kim
Version: 2.4.0
OS: Window XP
Submission from: (NULL) (210.110.8.105)
For the data c1 of size 14, stem provides the following result.
**************************************************************
>c1
[1] 14 39 70 11 38 20 37 15 41 74 74 34 48 51
ZZangi>stem(c1)
The decimal point is 1 digit(s) to the right of the |
0 | 145
2 | 04789
4 | 181
6 | 044
2005 Dec 23
1
how to specify dev.print target by a variable?
I want to do the following:
DEVw=500
DEVh=350
fname="my_plot"
dev.print(file=fname, device=FOO, width=DEVw, height=DEVh, bg="transparent")
How do I do this such that I can specify FOO to be one of several choices? (GDD, PNG, postscript, etc.)
If I make FOO a character variable, then "dev.print" complains.
I tried a simpled "substitute" but
2006 Jun 01
1
"predict" function does not provide SE estimates for multivariate timeseries VAR models?
What can I do?
Thanks a lot!
[[alternative HTML version deleted]]
2006 Jul 23
1
How to pass eval.max from lme() to nlminb?
Dear R community,
I'm fitting a complex mixed-effects model that requires numerous
iterations and function evaluations. I note that nlminb accepts a
list of control parameters, including eval.max. Is there a way to
change the default eval.max value for nlminb when it is being called
from lme?
Thanks for any thoughts,
Andrew
--
Andrew Robinson
Department of Mathematics and Statistics
2006 Oct 26
1
A faster way to calculate Trace?
I want to know how to get trace of product of matrices **faster** when the matrices are really big. Unfortunately the matrices are not symmetric. If anybody know how to get the trace of it, please help me. An example is as below.
n <- 2500
a <- matrix(rnorm(n*n),n,n)
b <- matrix(rnorm(n*n),n,n)
tr1 <- sum(diag(a %*% b))
tr2 <- sum(diag(a %*% b %*% a %*% b))
Thanks,
Yongwan Chun