Displaying 20 results from an estimated 20000 matches similar to: "do.call, browser and traceback"
2007 May 12
2
Implicit vs explicit printing and the call stack
Hi everyone,
I've run into a bit of strange problem with implicit vs explicit
printing and the call stack. I've included an example at the bottom of
this email. The basic problem is that I have an S3 object with a
print method. When the object is implicitly printed (ie. typed
directly into the console) the function arguments in the call stack
are exploded out to their actual values,
1997 Aug 05
1
R-beta: Characters in .C
I am having some difficulties using dynamically loaded
C functions on a Sparc 10 with R compiled
using cc (both R-0.49 and R-0.50). I get sporadic errors with the
error message:
Error: character variables must be duplicated in .C/.Fortran,
with C functions which pass character variables.
my C functions look like: anyfunc(char **filename, other variables )
This error message appears about 25%
1997 Aug 05
1
R-beta: Characters in .C
I am having some difficulties using dynamically loaded
C functions on a Sparc 10 with R compiled
using cc (both R-0.49 and R-0.50). I get sporadic errors with the
error message:
Error: character variables must be duplicated in .C/.Fortran,
with C functions which pass character variables.
my C functions look like: anyfunc(char **filename, other variables )
This error message appears about 25%
2006 Sep 03
2
lm, weights and ...
> lm2 <- function(...) lm(...)
> lm2(mpg ~ wt, data=mtcars)
Call:
lm(formula = ..1, data = ..2)
Coefficients:
(Intercept) wt
37.285 -5.344
> lm2(mpg ~ wt, weights=cyl, data=mtcars)
Error in eval(expr, envir, enclos) : ..2 used in an incorrect context,
no ... to look in
Can anyone explain why this is happening? (Obviously this is a
manufactured example, but it
2009 Jan 07
1
Fw: Re: R Stacked Histogram
Hi Jason,
> Well, one last questions about stack plot (please forgive the lame example
> below). I thought the below allow me to resize the the "title" of the
> stacked histogram, but no luck. Any suggestions as to the modificaiton
> necessary to get it to work? Right now the title is obscured by the plot
> and my boss will be none too happy. Thanks again.
Yes,
2012 Jan 06
1
seq_along and rep_along
Hi all,
A couple of ideas for improving seq_along:
* It would be really useful to have a second argument dim:
seq_along(mtcars, 1)
seq_along(mtcars, 2)
# equivalent to
seq_len(dim(mtcars)[1])
seq_len(dim(mtcars)[2])
I often find myself wanting to iterate over the rows or column of a
data frame, and there isn't a particularly nice idiom if you want to
avoid problems
2006 Sep 18
2
Help for methods
Help for help says:
The 'topic' argument may also be a function call, to ask for
documentation on a corresponding method. See the section on
method documentation.
and
The authors of formal ('S4') methods can provide documentation on
specific methods, as well as overall documentation on the methods
of a particular function. The
2007 Sep 08
1
ggplot legend consolidation
Hello Everyone,
I have recently been introduced to the ggplot package by Hadley Wickham
and must say I am quite impressed so far at how easy it is to make
attractive plots, but one thing I am struggling over is how to
consolidate legends.
I have 3 plots that I would like to put on a single page and all 3 map
the same dimension of the data to the colour aesthetic. Right now, when
I plot all
2017 Mar 19
3
RFC: (in-principle) native unquoting for standard evaluation
Would this return a quosure? (i.e. a single sided formula that captures
both expression and environment). That's the data structure we've adopted
in tidyeval as it already has some built in support.
Hadley
On Friday, March 17, 2017, Michael Lawrence <lawrence.michael at gene.com>
wrote:
> Interesting idea. Lazy and non-standard evaluation is going to happen; the
> language
2016 Jun 04
1
RProfmem output format
I'm picking up this 5-year old thread.
1. About the four memory allocations without a stacktrace
I think the four memory allocations without a stacktrace reported by Rprofmem():
> Rprofmem(); x <- raw(2000); Rprofmem("")
> cat(readLines("Rprofmem.out", n=5, warn=FALSE), sep="\n")
192 :360 :360 :1064 :2040 :"raw"
are due to some
2013 Oct 30
2
Huge performance difference between implicit and explicit print
Hi all,
Can anyone help me understand why an implicit print (i.e. just typing
df at the console), is so much slower than an explicit print (i.e.
print(df)) in the example below? I see the difference in both Rstudio
and in a terminal.
# Construct large df as quickly as possible
dummy <- 1:18e6
df <- lapply(1:10, function(x) dummy)
names(df) <- letters[1:10]
class(df) <-
2009 Sep 02
1
Tracebacks & try
Hi all,
The help for traceback states:
Errors which are caught _via_ 'try' or 'tryCatch' do not generate
a traceback, so what is printed is the call sequence for the last
uncaught error, and not necessarily for the last error.
Is there any way to get a traceback (or something similar) for an
error raised inside a try block?
Regards,
Hadley
--
http://had.co.nz/
2009 Aug 16
2
bootstrapped correlation confint lower than -1 ?
Dear R users,
Does the results below make any sense? Can the the interval of the
correlation coefficient be between *-1.0185* and -0.8265 at 95%
confidence level?
Liviu
> library(boot)
> data(mtcars)
> with(mtcars, cor.test(mpg, wt, met="spearman"))
Spearman's rank correlation rho
data: mpg and wt
S = 10292, p-value = 1.488e-11
alternative hypothesis: true rho is not
2007 Nov 20
1
plotting confidence intervals of regression line
Hello,
I am trying to generate a confidence interval (90 or 95%) of a regression
line. This is primarily just for illustration on a scatter plot (i.e. I am
trying to make this
http://www.ast.cam.ac.uk/~rgm/scratch/statsbook/graphics/anima4.gif).
I have been trying to use the predict.lm function, with interval set as
"confidence", but this still seems to be giving me a prediction
2008 Dec 02
4
Bug in "transform"?
Dear useRs,
Here is a weird behavior of transform function:
mtcars1<-matcars
transform(mtcars1,t1=3,t2=4)
Error in data.frame(`_data`, e[!matched]) :
arguments imply differing number of rows: 32, 1
instead, this works:
mtcars1$t1<-0
transform(mtcars1,t1=3,t2=4)
also works if applied in turn:
transform(mtcars1,t1=3)
transform(mtcars1,t2=4)
I often need to use this
2007 Oct 01
4
how to plot a graph with different pch
I am trying to plot a graph but the points on the graph should be
different symbols and colors. It should represent what is in the legend.
I tried using the points command but this does not work. Is there
another command in R that would allow me to use different symbols and
colors for the points?
Thank you kindly.
data(mtcars)
plot(mtcars$wt,mtcars$mpg,xlab= "Weight(lbs/1000)",
2007 Jun 29
1
Print grid/ggplot to a metafile
Dear UseRs called Hadley, or Paul,
I am trying to print an edited ggplot2/grid graphics to a metafile. With the
commented line below it works, but when I edit the plot by uncommenting the
line, it fails, because it's illegal to have 2 graphics in a metafile. It
works with pdf, but even then I get two plots, which is a nuisance.
I found a workaround by using windows(); savePlot, but it only
2004 Apr 18
2
Error in gam?
I'm having some problems using variable names containing spaces (using
backticks) with gam (mgcv 0.9-6, R 1.8.1). Some toy code to reproduce
my problem is below. Am I doing something wrong, or should I pass this
bug on to Simon Wood? (Or do I need to rename my variables to get rid of
the spaces?)
Thanks,
Hadley
library(mgcv)
test <- data.frame(a = c(1:10), `a b` = c(1:10)^2,
2015 Jan 26
2
Inspect a "delayed" assigned whose value throws an error?
Hi, I got an interesting programming challenge:
How do you inspect an object which is assigned via delayedAssign() and
that throws an error as soon as it is "touched" (=the value is
evaluated)? Is it possible?
MINIMAL EXAMPLE:
$ R --vanilla
> delayedAssign("foo", stop("Hey!"))
(If you find this minimal example silly/obvious, please skip down to
the real
2006 May 09
1
Seg fault when installing package from bad repository
> install.packages("rggobi", repos="http://ggobi.org/r/")
Warning in install.packages("rggobi", repos = "http://ggobi.org/r/") :
argument 'lib' is missing: using /Users/hadley/Library/R/library/
Reading symbols for shared libraries . done
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at