Cleber N.Borges
2015-Dec-10 00:00 UTC
[R] there is a vectorinzing version of "[[<-" for "tclArray" class ?
hi all, there is a vectorinzing version of "[[<-" for "tclArray" class ? TIA cleber ##### > library(tcltk); getS3method("[[<-",'tclArray') function (x, ..., value) { name <- as.character(x) i <- paste(..., sep = ",") if (is.null(value)) .External(.C_RTcl_RemoveArrayElem, name, i) else { value <- as.tclObj(value) .External(.C_RTcl_SetArrayElem, name, i, value) } x } <bytecode: 0x000000000e7ab608> <environment: namespace:tcltk> > --- Este email foi escaneado pelo Avast antiv?rus. https://www.avast.com/antivirus
phgrosjean at sciviews.org
2015-Dec-10 07:27 UTC
[R] there is a vectorinzing version of "[[<-" for "tclArray" class ?
library(tcltk) methods(class = "tclArray") ## [1] [[ [[<- $ $<- length length<- names names<- ## see '?methods' for accessing help and source code It should be something like `[<-`. But this one is not defined. Perhaps can you contribute one here? Best, Philippe Grosjean> On 10 Dec 2015, at 01:00, Cleber N.Borges <klebyn at yahoo.com.br> wrote: > > hi all, > there is a vectorinzing version of "[[<-" for "tclArray" class ? > TIA > cleber > ##### > > library(tcltk); getS3method("[[<-",'tclArray') > function (x, ..., value) > { > name <- as.character(x) > i <- paste(..., sep = ",") > if (is.null(value)) > .External(.C_RTcl_RemoveArrayElem, name, i) > else { > value <- as.tclObj(value) > .External(.C_RTcl_SetArrayElem, name, i, value) > } > x > } > <bytecode: 0x000000000e7ab608> > <environment: namespace:tcltk> > > > > > --- > Este email foi escaneado pelo Avast antiv?rus. > https://www.avast.com/antivirus > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
peter dalgaard
2015-Dec-10 12:36 UTC
[R] there is a vectorinzing version of "[[<-" for "tclArray" class ?
On 10 Dec 2015, at 08:27 , phgrosjean at sciviews.org wrote:> library(tcltk) > methods(class = "tclArray") > > ## [1] [[ [[<- $ $<- length length<- names names<- > ## see '?methods' for accessing help and source code > > It should be something like `[<-`. But this one is not defined. Perhaps can you contribute one here?However, first ensure that you understand the section about Tcl arrays on the help page, and its implications. In particular, logical indexing and multidimensional indexing would never work. -pd> Best, > > Philippe Grosjean >> On 10 Dec 2015, at 01:00, Cleber N.Borges <klebyn at yahoo.com.br> wrote: >> >> hi all, >> there is a vectorinzing version of "[[<-" for "tclArray" class ? >> TIA >> cleber >> ##### >>> library(tcltk); getS3method("[[<-",'tclArray') >> function (x, ..., value) >> { >> name <- as.character(x) >> i <- paste(..., sep = ",") >> if (is.null(value)) >> .External(.C_RTcl_RemoveArrayElem, name, i) >> else { >> value <- as.tclObj(value) >> .External(.C_RTcl_SetArrayElem, name, i, value) >> } >> x >> } >> <bytecode: 0x000000000e7ab608> >> <environment: namespace:tcltk> >>> >> >> >> --- >> Este email foi escaneado pelo Avast antiv?rus. >> https://www.avast.com/antivirus >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com