Displaying 20 results from an estimated 30000 matches similar to: "rbind invisible return value (PR#343)"
2003 Jul 29
2
cbind/rbind inconsistency with NULL parameter (PR#3585)
R-Version: 1.7.1 (2003-06-16)
OS: Debian/GNU Linux
cbind and rbind handle NULL parameters inconsistently.
Consider:
> cbind()
NULL
> cbind(NULL)
NULL
And:
> cbind(diag(x = 1, 1, 1))
[,1]
[1,] 1
> cbind(NULL, diag(x = 1, 1, 1))
[,1]
[1,] 1
These seem to indicate that NULL parameters will be ignored in any call to
cbind and rbind. However:
>
2001 Jun 18
1
"[.data.frame" allows un-named 3rd subscript (PR#989)
Since the Extract page has usage as:
x[i, j, ... , drop=TRUE]
I would expect that 'drop=' would need to be given to the third 'subscript'
> diag(4)[ , 4 , 4 ] # Forgot 'drop=' or added extra ','
Error in diag(4)[, 4, 4] : incorrect number of dimensions
>
> as.data.frame( diag(4) )[ , 4 , 4 ] # should return error, right?
[1] 0 0 0 1
Also note:
2003 Jul 30
0
cbind/rbind inconsistency with NULL parameter (PR#3595)
The R help for cbind/rbind states:
> For `cbind' (`rbind'), vectors of zero length are ignored unless
> the result would have zero rows (columns), for S compatibility.
> (Zero-extent matrices do not occur in S and are not ignored in R.)
I presume this means the S language as defined in the Blue Book ("The ^New
S Language", Becker Chambers & Wilks,
2011 Jul 07
4
Return invisible list
Hi, I'm new to R. I'm trying to do some extreme value theory analysis,
looking at the Mean Excess Plot of a series. These are the commands I type
to get the plot:
x=read.table("data.txt",header=T)
goa=(x[,3])
meplot(goa)
I can see the plot, but I would like to see the values of the x and y axis.
According to this page
2016 May 10
1
recursion problem using do.call(rbind, list(..,<S4>,..))
This was originally a bug report about Matrix,
https://r-forge.r-project.org/tracker/?func=detail&atid=294&aid=6325&group_id=61
but the bug is rather a "design" bug in R, or a limitation.
This e-mail is a report of the status quo as I see it, and
call for comments, sugguests, help/hints for workarounds,
or even a suggestion for a programming task helping R core to
amend
2018 Mar 20
1
WISH: Sys.setlocale() to return value invisibly
Contrary to, say, Sys.setenv(), Sys.setlocale() returns it's value
visibly. This means that if you for instance add:
Sys.setlocale("LC_COLLATE", "C")
to your .Rprofile file, it will print:
[1] "C"
at startup. The workaround is to wrap the call in invisible(), but I'd
argue that any "setter" function should return invisibly.
Some more details:
2006 Aug 11
2
invisible() - does not return immediately as return() does
Hi,
I stumbled across the following (unexpected for me) behavior after
replacing a return() statement in the middle of a function by invisible().
Example:
foo <- function() { cat("before\n"); return(); cat("after\n")}
>foo()
before
NULL
foo2 <- function() { cat("before\n"); invisible(TRUE); cat("after\n")}
>foo2()
before
after
I expected
2012 Aug 01
1
Different results between lda(mass) and spss discriminant analysis
Hi all,
I obtained a strage result with LDA (MASS) function in R with NIR data.
I tried both CV (leave one out cross validation) and splitting my data in
odd (training) and even (prediction) sets.
In all the cases the minimum error was near to 0.
Due to the strange result, I tried with SPSS IBM software and it give me
around 11% of minimum error with and without leave one out cross validation.
2003 May 08
3
Avoiding loops to spare time and memory
Is it possible to avoid the loop in the following function (or make the
function otherwise more efficient) and can someone point me to a
possible solution? (It would be great if hours could be reduced to
seconds :-).
# ---------------------------------------------
RanEigen=function(items=x,cases=y,sample=z)
{
X=matrix(rnorm(cases*items),nrow=cases,byrow=F)
S=crossprod(X-rep(1,cases) %*%
2008 Sep 09
1
Addendum to wishlist bug report #10931 (factanal) (PR#12754)
--=-hiYzUeWcRJ/+kx41aPIZ
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Hi,
on March 10 I filed a wishlist bug report asking for the inclusion of
some changes to factanal() and the associated print method. The changes
were originally proposed by John Fox in 2005; they make print.factanal()
display factor correlations if factanal() is called with rotation =
2011 Jul 06
1
Create simulated data's using mvrnorm
Hi All
This might be something very trivial but I seem to miss something in the
syntax or logic which makes me keep wandering around the problem without
arriving at a solution.
What I want to do is to simulate a sample data for performing cluster
analysis. I tried to use
x1= mvrnorm(10,rep(0.8,3),diag(3))
x2= mvrnorm(10,rep(0,3),diag(3))
x3= mvrnorm(10,rep(-0.5,3),diag(3))
x=rbind(x1,x2,x3)
2005 Jun 26
0
Factor correlations in factanal
Dear R-devel list members,
Ben Fairbank draw it to my attention that factanal() (in the stats package)
doesn't report factor correlations for oblique rotations. Looking at the
source, I see that factanal also doesn't save the factor-transformation
(rotation) matrix from which these correlations can be computed. I've
modified the source, attached below, so that the transformation
2014 Nov 10
1
ambiguity in the documented return value of Null() from package MASS
Hi,
Function Null from package MASS seems to return a matrix with zero columns and the expected number of rows when
the null space of the argument contains only the zero vector, e.g.
> library(MASS)
> diag(nrow=3)
[,1] [,2] [,3]
[1,] 1 0 0
[2,] 0 1 0
[3,] 0 0 1
> Null(diag(nrow=3))
[1,]
[2,]
[3,]
But the documentation of Null seems to imply that
2013 Apr 09
2
R crash
I have a generalized linear model to solve. I used package "geepack". When
I use the correlation structure "unstructured", I get a messeage that- R
GUI front-end has stopped working. Why this happens? What is the solution?
The r codes are as follows:
a<-read.table("d:/bmt.txt",header=T")
2011 May 12
2
Exporting interactive 3D plots with axes and labels
Hi,
I have a question about exporting interactive 3D plots. I use the following code to plot a contour of a trivariate normal distribution:
library(mvtnorm)
library(rgl)
library(misc3d)
n=25
x=seq(-3,3,length=n)
X=cbind(rep(x,each=n**2),rep(rep(x,each=n),n),rep(x,n**2))
p=array(dmvnorm(X,sigma=diag(3)*0.5+0.5),c(n,n,n))
contour3d(p,x,x,x,level=mean(p))
lim=c(-3,3)
2004 Feb 26
2
return value in function
suppose I have a function example:
getMatrix <- function(a,b){
A1<-diag(1,2,2)
}
If I want to get the both the A1 and dim(A1) from the function, Can I do
return(A1,dim(A1)) inside the function ? And how can I access A1 and dim(A1) later on?
---------------------------------
[[alternative HTML version deleted]]
2018 Dec 18
1
[PATCH] virtio-ccw: diag 500 may return a negative cookie
If something goes wrong in the kvm io bus handling, the virtio-ccw
diagnose may return a negative error value in the cookie gpr.
Document this.
Signed-off-by: Cornelia Huck <cohuck at redhat.com>
---
Even if the virtio spec is the correct place to specify what diag 500
subcode 3 does, we also should mention here that the cookie may be
an error.
---
2013 Feb 23
1
how to calculate left kronecker product?
For an application, I have formulas defined in terms of a left Kronecker
product of matrices,
A,B, meaning
A \otimes_L B = {A * B[i,j]} -- matrix on the left multiplies each
element on the right.
The standard kronecker() function is the right Kronecker product,
A \otimes_R B = {A[i,j] * B} -- matrix on the right multiplies each
element on the left.
The example below shows the result of
1999 Oct 31
1
diag
A change to diag() between 0.65.0 and 0.65.1 which seems undocumented in
the logs (apparently revision 1.3.2.1, `diag names') introduced
if (is.array(x))
stop("first argument is array, but not matrix.")
which has broken the code in rpart. This looks wrong to me, as diag used to
cope happily with a single-dimensional array. Such things occur quite
often as the output
2013 Sep 19
2
(no subject)
Dear R sages,
I used the function rbind to combine a matrix (M) and a vector (Fert) to
get a new matrix (A). This was fine.
The issue is however, that the new matrix A has as its row names the name
of the vector Fert, even though I set teh new vector A to have
dimnames=NULL. See short code below fyi.
*Fert<-c(0,1,5)
*
*M <- matrix(0, 2, 3)
diag(M) <- c(0.3,0.5)
*
*A<-