similar to: rowsum dimnames (PR#1092)

Displaying 20 results from an estimated 2000 matches similar to: "rowsum dimnames (PR#1092)"

2001 Sep 13
1
rowsum dimnames
Hi, The result of rowsum() in R doesn't have the dimnames I'd expect, e.g.: > rowsum(matrix(1:12, 3,4), c("Y","X","Y")) [,1] [,2] [,3] [,4] 1 2 5 8 11 2 4 10 16 22 whereas S-Plus gives the more useful result: [,1] [,2] [,3] [,4] X 2 5 8 11 Y 4 10 16 22 This is because R's rowsum() code gives
2001 Oct 03
8
Several R vs S-Plus issues
Hi, all, I've been converting code from S-Plus ("S" for short) to R for a few weeks. Here are some differences I've found, aside from the big well-known ones (scoping, models, data storage) and the contents of Kurt Hornik's FAQ section 3.3.3. Let me start with the ones that seem like serious bugs or deficiencies: 1) LETTERS[c(NA,2)] in S is
2001 Oct 03
8
Several R vs S-Plus issues
Hi, all, I've been converting code from S-Plus ("S" for short) to R for a few weeks. Here are some differences I've found, aside from the big well-known ones (scoping, models, data storage) and the contents of Kurt Hornik's FAQ section 3.3.3. Let me start with the ones that seem like serious bugs or deficiencies: 1) LETTERS[c(NA,2)] in S is
2001 Sep 27
5
Reading and writing to S-like databases
Hi, I asked this question 2 years ago, and would like to know if the answer has changed. In S-Plus, I build databases of many large objects. In any given analysis, I only need a few of those objects, but attach'ing the whole database is fine since objects are only read as needed. How can I do the same thing in R, without reading the entire database? One possibility is to treat
2001 Oct 03
0
RE: [R] Several R vs S-Plus issues (PR#1112)
Also in assign() there some arguments lacking in R such as 'frame' and 'where', though I guess that 'frame' in S may be similar to 'pos' in R. Harvey -----Original Message----- From: David Brahm [SMTP:a215020@agate.fmr.com] Sent: Wednesday, October 03, 2001 11:36 AM To: r-help@stat.math.ethz.ch Cc: Kurt.Hornik@ci.tuwien.ac.at; r-bugs@r-project.org Subject:
2001 Oct 03
0
Several R vs S-Plus issues (PR#1110)
Hi, all, I've been converting code from S-Plus ("S" for short) to R for a few weeks. Here are some differences I've found, aside from the big well-known ones (scoping, models, data storage) and the contents of Kurt Hornik's FAQ section 3.3.3. Let me start with the ones that seem like serious bugs or deficiencies: 1) LETTERS[c(NA,2)] in S is
2002 Mar 08
2
Sys.putenv environment variables disappear (PR#1371)
Environment variables set with Sys.putenv() disappear (i.e. become "") after a while, especially after heavy-duty I/O. Example: R> x <- matrix(1., 3000, 3000) R> save(x, file="myx.RData") R> Sys.putenv(HOME="/tmp") R> while (Sys.getenv("HOME") != "") {cat("ok\n"); load("myx.RData")} The loop prints
2008 Mar 05
1
coxme - fitting random treatment effect nested within centre
Dear all, I am using "coxme" function in Kinship library to fit random treatment effect nested within centre. I got 3 treatments (0,1,2) and 3 centres. I used following commands, but got an error. > ugroup=paste(rep(1:3,each=3),rep(0:2,3),sep='/') > mat1=bdsmatrix(rep(c(1,1,1,1,1,1,1,1,1),3),blocksize=rep(3,3),dimnames=list(ugroup,ugroup)) >
2003 Aug 13
2
rowsum() may return a vector instead of a matrix (PR#3737)
If all rows are in the same "group", rowsum() returns a vector instead of a (1xN) matrix, contrary to documentation: R> print(z <- rowsum(matrix(1:12, 3,4), rep("x",3))) [1] 6 15 24 33 R> dim(z) NULL It worked correctly in version 1.4.0 but was broken by version 1.6.1. I'm currently using 1.7.1 under Solaris 2.8. --please do not edit the information
2001 Oct 04
2
Characters subsetted with NA (was: Several R vs S-Plus issues)
Hello, R-devel! I posted to R-help, and (inappropriately) to R-bugs, this R/S-Plus difference: > LETTERS[c(NA,2)] in S is c("","B"), but in R is c("NA","B") Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> wrote: > I think we do not want to change this. ... > R> is.na(LETTERS[c(NA,2)]) [1] TRUE FALSE > so we really have NA but it is
2001 Dec 14
2
colSums in C
Hi, all! My project today is to write a speedy colSums(), which is a function available in S-Plus to add the columns of a matrix. Here are 4 ways to do it, with the time it took (elapsed, best of 3 trials) in both R and S-Plus: m <- matrix(1, 400, 40000) x1 <- apply(m, 2, sum) ## R=16.55 S=52.39 x2 <- as.vector(rep(1,nrow(m)) %*% m) ## R= 2.39 S= 8.52 x3 <-
2001 Sep 25
2
read.table() suggestions
Hi, I understand work is being done to improve read.table(), especially by Prof. Brian D. Ripley. I offer below a version that I wrote, in the hope some aspects of it may prove useful or at least inspire discussion. Be aware that my version differs in a couple fundamental ways that reflect my aversion to dataframes and factors. So it returns a list of vectors which are all character,
2002 Jul 10
1
bug in all.equal.character (PR#1767)
There is a bug in all.equal.character: > all.equal.character(c("A", "B", "C"), c("A", "B", "C")) [1] TRUE > all.equal.character(c("A", "B", "C"), c("A", "B", NA)) Error in sum(out) : Object "out" not found > traceback() 3: sum(out) 2: paste("`is.NA' value
2011 Mar 25
2
two minor bugs in rowsum()
(a) In R 2.12.2 rowsum can overflow if given an integer input: > rowsum(c(2e9L, 2e9L), c("a", "a")) [,1] a -294967296 > 2^32 + .Last.value [,1] a 4e+09 Should it be changed to coerce its x argument to numeric (double precision) so it always returns a numeric output? (b) When rowsum is given an x containing both NaN and NA it appears to use the last
2008 Mar 25
2
help with rowsum/aggregate type functions
Hi-- This is a question with a trivial and obvious answer, I'm sure, but I can't seem to find it in the help files and books that I have handy. I have a dataframe consisting of two columns, "Gene_Name," a list of gene symbols, and "Number," a numeric measure of how frequently a tag representing that gene showed up in a SAGE library. Several of the genes are
2003 Jan 23
0
Summary: Warnings with no INDEX file in a package
Thanks to Henrik Bengtsson, Martin Maechler, Brian Ripley, Jeff Gentry and David Brahm for taking the time to answer my questions about INDEX files in R packages. My key take-aways were: 1) All of this will be changing a lot in R 1.7.0-to-be, so don't sweat the details. 2) Many people run R CMD build before they run R CMD check. I found this quite surprising. I did not realize that R
2008 Dec 28
1
Random coefficients model with a covariate: coxme function
Dear R users: I'm new to R and am trying to fit a mixed model Cox regression model with coxme function. I have one two-level factor (treat) and one covariate (covar) and 32 different groups (centers). I'd like to fit a random coefficients model, with treat and covar as fixed factors and a random intercept, random treat effect and random covar slope per center. I haver a couple of
2010 Oct 20
2
rowsum
Hello, I am trying to achieve something which I *think* is possible using rowsum, but a little help should be useful: Consider the following dataframe DF0: A B C 89 1 140 89 06 20 89 29 137 89 52 13 89 57 10 89 97 23 89 1 37 89 1 12 89 1 3 52 1 11 52 1 31 52 1 16 52 1 6 52 1 10 52 1 13 52 1 10 52 1 25 52 1 2 52 59 38 52 97 75 57 1 14 57 1 13 57 1 14 57 114 12 57 1 23 57 06 26 I need create a
2016 Sep 15
2
row names of 'rowsum()'
'rowsum()' seems to add row names to the resulting matrix, corresponding to the respective 'group' values. This is very handy, but it is not documented. Should the documentation mention it so it could be relied upon as part of API? Cheers, Ott -- Ott Toomet Visiting Researcher School of Information Mary Gates Hall, Suite 310 University of Washington Seattle, WA 98195
2002 Aug 15
1
order(1, na.last=NA) fails (PR#1913)
R> order(1, na.last=NA) Error in apply(sapply(z, is.na), 1, any) : dim(X) must have a positive length This bug appears unrelated to PR#1906, and so the fix of 8/15 doesn't help. It comes from the line inside order(): ok <- !apply(sapply(z, is.na), 1, any) where z=list(1) in my example. sapply() returns a single-element vector, not a matrix, making apply() unhappy. This might