similar to: Inconsistency when naming a vector

Displaying 20 results from an estimated 6000 matches similar to: "Inconsistency when naming a vector"

2015 Apr 27
0
Inconsistency when naming a vector
> On 27 Apr 2015, at 13:48 , Hadley Wickham <h.wickham at gmail.com> wrote: > > Sometimes the absence of a name is maked by an NA: > > x <- 1:2 > names(x)[[1]] <- "a" > names(x) > # [1] "a" NA > > Whereas other times its > > y <- c(a = 1, 2) > names(y) > # [1] "a" "" > > Is this deliberate?
2006 Aug 31
2
Wish: keep names in mapply() result
Hello! I have noticed that mapply() drops names in R 2.3.1 as well as in r-devel. Here is a simple example: l <- list(a=1, b=2) k <- list(1) mapply(FUN="+", l, k) [1] 2 3 mapply(FUN="+", l, k, SIMPLIFY=FALSE) [[1]] [1] 2 [[2]] [1] 3 Help page does not indicate that this should happen. Argument USE.NAMES does not have any effect here as it used only in a bit special
2018 Aug 25
2
Where does L come from?
Not that it brings closure, but there's also https://stat.ethz.ch/pipermail/r-devel/2017-June/074462.html Henrik On Sat, Aug 25, 2018, 06:40 Marc Schwartz via R-devel <r-devel at r-project.org> wrote: > On Aug 25, 2018, at 9:26 AM, Hadley Wickham <h.wickham at gmail.com> wrote: > > > > Hi all, > > > > Would someone mind pointing to me to the
2015 May 05
3
Why is the diag function so slow (for extraction)?
Looks like the c(x)[...] bit used to be as.matrix(x)[...]. Not sure why the change was made many years ago, but this was before names were handled explicitly. It would definitely be better to not force the duplicate, at least in the case where we are sure c() and [ would not dispatch. Best, luke On Mon, 4 May 2015, peter dalgaard wrote: > >> On 04 May 2015, at 19:59 , franknarf
2011 Jan 11
6
(JOB) Ruby on Rails Developers- Strongmail , Redwood Shores, CA
Ruby on Rails Developers Dreaming about working on next generation products with a social media aspect where you get to truly innovate? Stop dreaming and start doing. As part of a collaborative team working on a 2 week Agile cycle, you’ll be responsible for development of new modules in our rapidly expanding product suite - products used by switched on brands to touch millions of end users.
2007 Sep 29
1
templates with same name before extension are cached
Hi all, I was just wondering if this is the intended behavior. Here is my setup: controller def index respond_to do |f| f.xml { render :xml => true } f.html { render :layout => :none } end end In my views I have a file for each type index.herb index.xerb The first request I send is cached and interferes with the other one. For example, if I send an xml request
2007 Jul 10
1
Lattice: vertical barchart
barchart(Titanic, stack=F) produces a very nice horizontal barchart. Each panel has four groups of two bars. barchart(Titanic, stack=F, horizontal=F) doesn't produce the results I would have expected, as it produces this warning message: Warning message: y should be numeric in: bwplot.formula(x = as.formula(form), data = list(Class = c(1, And it results in each panel having 22 groups of
2005 Oct 19
3
diag() problem
Hi I have a matrix "u", for which diag() gives an error: u <- structure(c(5.42334674128216, -2.31319389204264, -5.83059042218476, -1.64112369640695, -2.31319389212801, 3.22737617646609, 1.85200668021569, -0.57102273078531, -5.83059042231881, 1.85200668008156, 11.9488923894962, -3.5525537165941, -1.64112369587405, -0.571022730886046, -3.55255371755604,
2007 Jun 01
2
Getting names of objects passed with "..."
Is there a tidy way to get the names of objects passed to a function via the "..." argument? rbind/cbind does what I want: test.func1 <- function(...) { nms <- rownames(rbind(..., deparse.level=1)) print(nms) } x <- "some stuff" second <- "more stuff" test.func1(first=x, second) [1] "first" "second" The usual
2015 May 12
2
Why is the diag function so slow (for extraction)?
>>>>> Steve Bronder <sbronder at stevebronder.com> >>>>> on Thu, 7 May 2015 11:49:49 -0400 writes: > Is it possible to replace c() with .subset()? It would be possible, but I think "entirely" wrong. .subset() is documented to be an internal function not to be used "lightly" and more to the point it is documented to *NOT*
1999 Aug 18
2
diag()
I would like to suggest a slight modification to diag(). In the case where x is a matrix with both row names and column names the same, it would be reasonable if the resulting vector also had those names. I often use diag() on variance matrices, where this modification is helpful. The modification requires replacing if (is.matrix(x) && nargs() == 1) return(c(x)[1 +
2011 Feb 19
1
Accessing Package NEWS (NEWS.Rd)
Okay. So, after having spent quite some time never really tracking down why my package NEWS files were unacceptable to readNEWS(), I noticed that there was recent (to me anyway) development that allowed the NEWS to be done as an Rd file. Sweet! A more standard format... I converted a NEWS file in one of my unreleased packages to Rd format. checkNEWS() gave it a thumbs up. But then it went south.
2008 May 08
3
Setting matrix dimnames in a list
Hey All, I was wondering if I could solicit a little input on what I'm trying to do here. I have a list of matrices, and I want to set their dimnames, but all I can come up with is this: x <- matrix(1:4,2) y <- matrix(5:8,2) z <- list(x,y) nm <- c("a","b") nms <- list(nm,nm) z <- lapply(z,function(x)dimnames(x)<-nms) As you can see, this
2015 May 13
1
Why is the diag function so slow (for extraction)?
As kindly pointed out to me (oh my decaying gray matter), is.object() is better suited for this test; $ svn diff src/library/base/R/diag.R Index: src/library/base/R/diag.R =================================================================== --- src/library/base/R/diag.R (revision 68345) +++ src/library/base/R/diag.R (working copy) @@ -23,9 +23,11 @@ stop("'nrow' or
2005 Sep 27
2
Integration with NMS AG-E1/T1
I want to replace a custom PBX, that is infront on a IVR system based on OLD NMS AG-E1 Card. The Cards is configurated with CAS Digitalmode, someone can give me some info about Digim Cards CAS configuration i need a conversion Table? I wanto to don't touch configuration on winbox, i want only replace HWPBX box with asterisk. Diagram Telco E1 ===>Proprietary PBX========(CAS)===>IVR
2012 Jun 15
2
strings concatenation and organization (fast)
Hello, What is the fastest way to do this? I has to be done quite a few times. Basically I have sets of 3 numbers (as characters) and sets of 3 dashes and I have to store them in named columns. The order of the sets and the column name they fall under is important. The actual numbers and the pattern/order of the sets should be considered random/unpredictable. Sample data: vec =
2003 May 21
2
moving onto returning a data.frame?
I've been studying some of the code and I'm still a little shakey on the proper method for returning a data.frame from a C function (which is my ultimate goal here). I've started some code that I've "stolen" from the archives and I'm running into crashes, etc. I've been trying to gleen some insight from the src/main/scan.c file and didn't find many comments in
2009 Feb 03
1
Automatic creation of columns in zoo object
Hello, everyone I have a question. Assume I have the following zoo object: me.la <- structure(c(1524.75, 1554.5, 1532.25, 1587.5, 1575.25, 1535.5, 1550, 1493.5, 1492.5, 1472.25, 1457.5, 1442.75, 1399, 1535.75, 1565.25, 1543.5, 1598.5, 1586.5, 1547, 1561.5, 1504.75, 1503.75, 1483.75, 1468.75, 1453.75, 1410, 1546.75, 1575.25, 1554, 1609, 1597.5, 1558.5, 1573, 1516.25, 1515.5, 1495, 1480, 1465,
2007 Feb 27
1
Function to do multiple named lookups faster?
Hi, I apologize if this topic has been discussed - I could not figure out a good search phrase for this question. I have a named vector x, with multiple (duplicate) names, and I would like to obtain a (shorter) vector with non-duplicate names in which the values are the means of the values of the duplicated indexes in x. My best (fastest) solution to this was this code: nms <- names( x )
2009 Jan 23
1
"for" loop wiht S4 Objects
Hi all, I'm working with the S4-Class system and I have a little problem with Implementing iteration functionality in my S4 class but it don't work: > setClass("foo",representation(bar="list")) > x <- new("foo",bar=list(1,2,3)) >for(e in x) cat(e) invalid type/length (S4/1) in vector allocation But when I extend from a