Displaying 20 results from an estimated 10000 matches similar to: "print.<strorageMode>() not called when autoprinting"
2019 May 21
2
print.<strorageMode>() not called when autoprinting
It also is a problem with storage.modes "integer" and "complex":
3.6.0> print.integer <- function(x,...) "integer vector"
3.6.0> 1:10
[1] 1 2 3 4 5 6 7 8 9 10
3.6.0> print(1:10)
[1] "integer vector"
3.6.0>
3.6.0> print.complex <- function(x, ...) "complex vector"
3.6.0> 1+2i
[1] 1+2i
3.6.0>
2019 May 21
3
print.<strorageMode>() not called when autoprinting
Letting a user supply the autoprint function would be nice also. In a way
you can already do that, using addTaskCallback(), but that doesn't let you
suppress the standard autoprinting.
Having the default autoprinting do its own style of method dispatch doesn't
seem right.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, May 21, 2019 at 10:50 AM Lionel Henry <lionel at
2019 May 22
0
print.<strorageMode>() not called when autoprinting
>>>>> William Dunlap
>>>>> on Tue, 21 May 2019 12:11:45 -0700 writes:
> Letting a user supply the autoprint function would be nice also. In a way
> you can already do that, using addTaskCallback(), but that doesn't let you
> suppress the standard autoprinting.
> Having the default autoprinting do its own style of method dispatch
2019 May 21
0
print.<strorageMode>() not called when autoprinting
FWIW it was the intention of the patch to make printing of unclassed
functions consistent with other base types. This was documented in the
"patch 3" section:
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17398
I think we need a general way to customise auto-printing for base types
and even classed objects as that'd be useful for both users and IDEs.
However S3 dispatch may
2019 May 22
1
print.<strorageMode>() not called when autoprinting
Hi Martin,
> On 22 May 2019, at 03:50, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>
> I'm pretty sure that all teaching and documentation about S and R
> has suggested that print(f) and auto-printing should result in
> the same output _ AFAIR also for S4 objects
I agree with the principle that autoprint and print() should be
equivalent for users. However
2017 Jan 09
1
problem with print.generic(x)deparse(substitute(x))
Hi, Peter et al.:
On 2017-01-09 4:24 AM, peter dalgaard wrote:
> On 09 Jan 2017, at 10:53 , Spencer Graves <spencer.graves at prodsyse.com> wrote:
>
>> # Define an object of class 'dum'
>> k <- 1
>> class(k) <- 'dum'
>> str(k) # as expected
>>
>> # Define print.dum
>> print.dum <- function(x, ...)
>>
2017 Jan 09
2
problem with print.generic(x)deparse(substitute(x))
Hi, All:
I'm having trouble getting deparse(substitute(x)) inside
print.generic to consistently
I'm having trouble getting a print.something to work
consistently. Consider the following toy example:
# Define an object of class 'dum'
k <- 1
class(k) <- 'dum'
str(k) # as expected
# Define print.dum
print.dum <- function(x, ...)
2017 Aug 14
0
recursive lapply and keeping track of data
You could replace your 'depth' argument with one that shows where in the
original data you are at:
leaf.func <-
function(data, where) {
if(is.null(data)) stop("Null data at ", deparse(where))
return(mean(data))
}
visit.level <-
function(data, where = integer()) {
if (length(where) == 2) {
return(leaf.func(data, where))
} else
2017 Aug 14
2
recursive lapply and keeping track of data
Hello,
I'm writing a program that takes a tree in input (nested lists) and
returns a copy of it replacing the leaves with something else (eg: a
computation done on the original leaves).
In the example below, the tree is composed by countries and cities,
and the leaves (children of the cities) are vectors of numbers. The
program takes this tree and replaces the vectors at the bottom by
their
2009 Nov 22
2
Help with indexing
Dear R Helpers,
I am missing something very elementary here, and I don't seem to get it from the help pages of the ave, seq and seq_along functions, so I wonder if you could offer a quick help.
To use an example from an earlier post on this list, I have a dataframe of this kind:
dat = data.frame(name = rep(c("Mary", "Sam", "John"), c(3,2,4)))
dat$freq =
2011 Sep 15
2
Returning the name of an object passed directly or from a list by lapply
Dear folks:
Let?s suppose I want a function to print return the name of the object
passed to it.
> myname <- function(object) {out<-deparse(substitute(object)); out}
This works fine on a single object:
> O1 <-c(1:4)
> myname(O1)
[1] "O1"
However it does not work if you use lapply to pass it the same object from a
list:
> O2 <-c(1:4)
> object.list <-
2018 Mar 29
2
Pasar argunmentos string a una formula
Buenas
Tengo en un string guardado lo siguiente:
> parametros
[1] "ntree=10" "ntree=30" "ntree=50" "ntree=100" "ntree=200"
Con un bucle for quiero ir metiendolo en el modelo, pero no se muy bien como hacerlo, ya que con deparse no me funciona, con get tampoco (obvio, no es un objeto), y no se muy bien como hacerlo de manera dinamica
2007 Oct 22
2
Help interpreting output of Rprof
Hello there,
I am not quite sure how to interpret the output of Rprof (in the following the output I was staring at). I was poking around the web a little bit for documentation but without much success. I guess if I want to figure out what takes so long in my code the 2nd table $by.total and the total.pct column (pct = percent) is the most helpful. What does it mean that [ or [.data.frame is
2008 Dec 22
2
... (dotMethods) and cbind/rbind: how to give the signature?
Dear List,
I'm struggling with the signature writing cbind/rbind functions for a S4
class.
First of all, I'm very happy that it is now possible to dispatch on ...
I follow the example for "paste" in ?dotMethods, which works as far as this:
### start example
setClass ("cbtest",
representation = representation (data = "data.frame"),
2016 Apr 13
0
formula argument evaluation
%=>% would have precendence ('order of operations') problems also.
A + B %=>% C
is equivalent to
A + ( B %=>% C)
and I don't think that is what you want.
as.list(quote(A + B %=>% C)) shows the first branch in the parse tree. The
following function, str.language, shows the entire parse tree, as in
> str.language(quote(A + B %=>% C))
`quote(A + B %=>%
2017 Jan 09
0
problem with print.generic(x)deparse(substitute(x))
On 09 Jan 2017, at 10:53 , Spencer Graves <spencer.graves at prodsyse.com> wrote:
> # Define an object of class 'dum'
> k <- 1
> class(k) <- 'dum'
> str(k) # as expected
>
> # Define print.dum
> print.dum <- function(x, ...)
> deparse(substitute(x))
>
> print(k) # Prints "k" as expected
> #####**** THE FOLLOWING PRINTS
2012 Nov 28
3
write out list of lists with names
Hello List
I have a list question. I'm doing some data wrangling for a colleague and I have nested list in the following format:
structure(list(MU10 = structure(c(0.80527905920989, 0.4350488707836,
0.455195366623, 0.565174432205497, 0.208180556861924), .Names = c("MU.16",
"MU.19", "MU.21", "mean", "sd")), MU11 =
2019 Mar 02
1
stopifnot
A private reply by Martin made me realize that I was wrong about
stopifnot(exprs=TRUE) .
It actually works fine. I apologize. What I tried and was failed was
stopifnot(exprs=T) .
Error in exprs[[1]] : object of type 'symbol' is not subsettable
The shortcut
assert <- function(exprs) stopifnot(exprs = exprs)
mentioned in "Warning" section of the documentation similarly fails
2019 Jul 14
3
Potential bug with data.frame replacement
Dear R-devel,
I have encountered a crash-inducing scenario and would like to enquire as to
whether this would be considered a bug. To reproduce the crash:
X <- sample(letters, 3000, TRUE)
D <- data.frame(X, 1:3000, X, X, X, X, X)
D$X1.3000 <- paste0("GSM", D)
The reason why I'm not sure if this would be considered a bug is because I
typed this by accident, when what I
2024 Feb 07
1
[EXTERNAL] Re: NOTE: multiple local function definitions for ?fun? with different formal arguments
I put the idea below into a function that gives nicer looking results.
Here's the new code:
dupnames <- function(path = ".") {
Rfiles <- pkgload:::find_code(path)
allnames <- data.frame(names=character(), filename=character(), line
= numeric())
result <- NULL
for (f in Rfiles) {
exprs <- parse(f, keep.source = TRUE)
locs <-