Displaying 20 results from an estimated 10000 matches similar to: "Vectorial analogue of all.equal()?"
2010 Mar 04
4
Analogue to SPSS regression commands ENTER and REMOVE in R?
I am not sure if this question has been asked before - but is there a
procedure in R (in lm or glm?) that is equivalent to ENTER and REMOVE
regression commands in SPSS?
Thanks a lot!
--
Dimitri Liakhovitski
Ninah.com
Dimitri.Liakhovitski at ninah.com
2007 Jun 10
3
find position
find the position of the first value who equals certain number in a vector:
Say a=c(0,0,0,0,0.2, 0.2, 0.4,0.4,0.5)
i wish to return the index value in a for which the value in the vector is
equal to 0.4 for the first time. in this case, it is 7.
[[alternative HTML version deleted]]
2011 Apr 06
4
problem with all/all.equal
Hi!
In a function, I may have an instance in which all elements are equal.
> x <- rep(1,5)
>
> x
[1] 1 1 1 1 1
> identical(x)
Error in .Internal(identical(x, y, num.eq, single.NA, attrib.as.set)) :
'y' is missing
> all.equal(x)
Error in is.expression(x) : 'x' is missing
>
I don't care what particular value it is, I just want to know if they are
all
2011 May 19
1
vectorial search for elements with certain attributes
I have 2 vectors A and B. For each element of B I'd like to find the index of the next higher or equal element in A. And I'd like to store it effectiv. E.g.:
A <- c(1,3,7,8,10)
B <- c(5,8)
result: 3, 4
I have a possibility but for long vectors it works not very effectiv:
ans <- sapply(B, function(x) which.max(A[A < x]) )
as.integer(ans + 1)
Is there anyone how has a better
2005 Mar 08
2
a==0 vs as.integer(a)==0 vs all.equal(a,0)
hi
?integer says:
Note that on almost all implementations of R the range of
representable integers is restricted to about +/-2*10^9: 'double's
can hold much larger integers exactly.
I am getting very confused as to when to use integers and when not to.
In my line
I need exact comparisons of large integer-valued arrays, so I often use
as.integer(),
but the above
2006 Oct 03
1
do.call with Vectorial Argument
Dear All,
I am trying to use the do.call command to avoid tedious loops in R
when I need to call repetitively a function.
I am experiencing a problem when the arguments of a function are given
with a vector (I need to express then this way to be able later on to
integrate them numerically with the adapt package).
Consider the small script:
remove(list=ls())
#library(adapt)
# first a list of the
2012 Apr 26
2
How does .Fortran "dqrls" work?
Hi, all.
I want to write some functions like glm() so i studied it.
In glm.fit(), it calls a fortran subroutine named "dqrfit" to compute least
squares solutions
to the system
x * b = y
To learn how "dqrfit" works, I just follow how glm() calls "dqrfit" by my
own example, my codes are given below:
> qr <-
>
2011 Oct 23
0
FW: Re: symmetric matrix multiplication
Just to avoid possible confusion, let me correct a typo
(at step [2] in the example below). Apologies!
-----FW: <XFMail.111023084327.ted.harding at wlandres.net>-----
Date: Sun, 23 Oct 2011 08:43:27 +0100 (BST)
Sender: r-help-bounces at r-project.org
From: (Ted Harding) <ted.harding at wlandres.net>
To: r-help at r-project.org
Subject: Re: [R] symmetric matrix multiplication
On
2013 Jan 09
0
[solved] t-test behavior given that the null hypothesis is true
Hi Ted,
yes this was the problem. Thank you very much.
best
idaios
On Wed, Jan 9, 2013 at 4:51 PM, Ted Harding <Ted.Harding@wlandres.net>wrote:
> Ah! You have aqssigned a parameter "equal.var=TRUE", and "equal.var"
> is not a listed paramater for t.test() -- see ?t.test :
>
> t.test(x, y = NULL,
> alternative = c("two.sided",
2013 Jan 16
1
R CMD check not reading R_LIBS from ~/.R/check.Renviron
Dear List,
Further to my earlier email, I note that, for me at least, R CMD check
is *not* reading R_LIBS from ~/.R/check.Renviron on R 2.15.2 patched
(r61228) and R Under Development (r61660). The only way I can get R CMD
check to look for packages in a user-supplied library is by explicitly
exporting R_LIBS set to the relevant directory.
R CMD build *does* read R_LIBS from ~/.R/build.Renviron
2005 Aug 09
2
How to pre-filter large amounts of data effectively
Hi,
I'm a R newbie and want to accelerate the following pre-filtering
step of a data set with more than 115,000 rows :
#-----------------
# Function to filter out constant data columns
filter.const<-function(X, vectors=c('column', 'row'), tol=0){
realdata=c()
filteredX<-matrix()
if( vectors[1] == 'row' ){
for( row in (1:nrow(X)) ){
if(
2013 Apr 25
2
Decomposing a List
Greetings!
For some reason I am not managing to work out how to do this
(in principle) simple task!
As a result of applying strsplit() to a vector of character strings,
I have a long list L (N elements), where each element is a vector
of two character strings, like:
L[1] = c("A1","B1")
L[2] = c("A2","B2")
L[3] = c("A3","B3")
2005 May 30
3
how to invert the matrix with quite small eigenvalues
Dear all,
I encounter some covariance matrix with quite small eigenvalues
(around 1e-18), which are smaller than the machine precision. The
dimension of my matrix is 17. Here I just fake some small matrix for
illustration.
a<-diag(c(rep(3,4),1e-18)) # a matrix with small eigenvalues
b<-matrix(1:25,ncol=5) # define b to get an orthogonal matrix
b<-b+t(b)
bb<-eigen(b,symmetric=T)
2007 Apr 24
1
Values greater than 1 or lower than -1 in ARMAacf
Dear all,
I need to compute the ACF (autocorrel) of an AR6 process, given the values
of its parameters (w1,w2,w3,w4,w5,w6).
First, I notice that there is an error as soon as the sum of the wi equals 1
:
"Error in drop(.Call("La_dgesv", a, as.matrix(b), tol, PACKAGE = "base")) :
system is computationally singular: reciprocal condition number =
1.00757e-18"
2013 Jul 16
2
Problem following an R bug fix to integrate()
I have been told by the CRAN administrators that the following code generated
an error on 64-bit Fedora Linux (gcc, clang) and on Solaris machines (sparc,
x86), but runs well on all other systems):
> fn <- function(x, y) ifelse(x^2 + y^2 <= 1, 1 - x^2 - y^2, 0)
> tol <- 1.5e-8
> fy <- function(x) integrate(function(y) fn(x, y), 0, 1,
2002 Jun 07
1
Rank of a matrix?
Hello everyone,
this is a very simple question but I could not find the answer. :-(
Is there any function in R for calculating the rank of a matrix?
(In the sense of the dimension of the vectorial space that spans)
Thank you in advance!
Manuel
---
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2013 Mar 26
2
edit.data() read-only?
Greetings All.
The function edit.data() allows a convenient spreadsheet-like
view of a dataframe with too many rows/columns to fit on the
screen (especially when there are many columns). Very useful
when scanning through a dataset (row & column are conveniently
identified by the labels at the side and above).
However, there seens to be no option to set it "read-only" on
start-up,
2012 Feb 25
2
Finding name of variable supplied as function argument
Greetings All.
I want to do the following simple thing. I have defined
a function med3x3() such that, given vectors X,Y,
med3x3(X,Y) returns a 3x3 table where:
Row 1: X > median(X)
Row 2: X = median(X)
Row 3: X < median(X)
Col 1: Y < median(Y)
Col 2: Y = median(Y)
Col 3: Y > median(Y)
(with intersections of these conditions for the individual cells).
I can easily define fixed
2003 Jul 21
3
Confidence Band for empirical distribution function
Hi,
I was trying to draw an empirical distribution function with uniform
confidence bands. So I tried to find a way to calculate values of the
Kolmogorov-Smirnov Distribution but failed.
I guess it must be hidden somewhere (since the ks-test is implemented),
but I was unable to find it.
Is there any way to do this?
Thanks
Leif Boysen
2012 Jul 10
2
RGB components of plot() colours
A quick question:
Is there anywhere a listing of the RGB components of the
named colours listed by colors()?
For example, where would I find the RGB for "orange1"
or "salmon"?
When I look at an EPS file from R where I have used
these colours, it seems that for:
"salmon":
0.9804 0.5020 0.4471 rgb
"orange1":
1 0.6471 0 rgb
However, this is a tedious way