Displaying 20 results from an estimated 10000 matches similar to: "modifying large R objects in place"
2005 Dec 23
2
cairo anyone?
Has anyone taken a shot at a Cairo graphics device yet? I half
expected to see one on either Paul's pages or Omegahat. :-)
---
Byron Ellis (ellis at stat.harvard.edu)
"Oook" -- The Librarian
2007 Nov 01
3
Curry: proposed new functional programming, er, function.
Hi all (especially R-core) I suppose,
With the introduction of the new functional programming functions into
base I thought I'd ask for a Curry() function. I use a simple one that
looks this:
Curry = function(FUN,...) { .orig = list(...);function(...)
do.call(FUN,c(.orig,list(...))) }
This comes in really handy when using say, heatmap():
2007 Aug 29
1
Modifying R_CheckStack for a speed increase
Greetings R developers,
R will run a little faster when executing "pure R" code if the function
R_CheckStack() is modified.
With the modification, the following code for example runs 15% faster
(compared to a virgin R-2.5.1 on my Windows XP machine):
N = 1e7
foo <- function(x)
{
for (i in 1:N)
x <- x + 1
x
}
2005 Mar 25
1
S4 methods semantics questions
Some quick questions about S4 methods.
Does the typing of S4 methods mean that lazy evaluation is no longer
possible? It seems that you would need to evaluate the arguments to
determine their type at dispatch.
Second, what role, if any, do default arguments play in S4 methods? I
notice that you can put default arguments into generics but that the
dispatch is still done on the type of the
2005 Dec 29
1
reinventing the wheel....
> ---------- Forwarded message ----------
> From: Byron Ellis <ellis at stat.harvard.edu>
> If we wanted to be truly radical we'd just accept that graphics
> devices and event loops are just special cases of the connection and
> merge the whole thing, thus more-or-less reinventing CLIM. :-)
Eventually, all programming languages grow up and become Lisp.
(progress,
2007 Apr 03
2
R callbacks
Hi,
I'm trying to understand (mostly from the R-exts manual) how to use
the callbacks declared in Rinterface.h. As a first attempt, I'm trying
to redefine ptr_R_WriteConsole in a very trivial manner. Here's my
code:
---------------
$ cat altr.c
int Rf_initialize_R(int ac, char **av);
#define R_INTERFACE_PTRS 1
#include <Rinterface.h>
extern int R_running_as_main_program;
2005 Dec 09
3
external pointers
I have some C data I want to pass back to R opaquely, and then back to
C. I understand external pointers are the way to do so.
I'm trying to find how they interact with garbage collection and object
lifetime, and what I need to do so that the memory lives until the
calling R process ends.
Could anyone give me some pointers? I haven't found much documentation.
An earlier message
2007 Feb 11
1
Graphics driver test script?
Hi,
1. I started work on a metapost graphics driver a week or so ago and it is
gradually taking shape. I'm building up my own test cases into a
script as I go, but
figured you may have a "canonical testing script" of cases a driver must handle?
2. The clipping function looks like being a tricky problem. It seems
to me that the
callers of the driver assume that clipping affects all
2007 Jul 06
1
Hook for running a function before evaluation
Hello,
I like much addTaskCallback() and friends. However, there are situations
were we would like to have a function run BEFORE, not after every
top-level tasks. I think specifically to reset options(width = ) to
accommodate to the current width of the console, using something like:
options(width = system("tput cols"))
I am sure there are many other situations where this could be
2007 Dec 19
1
interactive graphics devices
Hi
For all developers of add-on graphics devices: please note the
existence of deviceIsInteractive() for adding your device to the list of
devices for which dev.interactive() returns TRUE. (Available since R
2.6.0; thanks to Brian Ripley I think)
Paul
--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at
2007 Nov 21
2
Color coding
I'm probably not the first with this idea so I guess that there's a
complex issue behind it but since I couldn't find an answer I just
though to ask:
Wouldn't it be nice to have color coded objects as output of ls()
statement? Functions of one color and rest with other (at least). So
when I issue an ls() I could visually discern different types of
objects.
I often find myself
2007 Jan 03
2
How to execute R scripts simultaneously from multiple threads
Hi All,
My problem is about parallel execution of R-scripts. My platform is linux.
A program that is written in C needs to execute multiple R-scripts
simultaneously. The C program makes use of multi-threading. Each thread
must initiate the execution of one script. Performance is very important.
Appearantly the R C-API does not provide a mechanism for parallel
execution..
It is preferred
2007 Jul 07
1
R graphics device for flash apps
Byron,
I just read your blog (statcomp.blogspot.com, linked from your other
post) and rand across your idea of an R/Flash graphics device. I've also
been giving this some thought because of this amazing interactive flash app:
http://tools.google.com/gapminder
and others from http://www.gapminder.org/.
I would love more than anything to work on this. The only hitch is that
I'm so
2005 Mar 22
2
can R_do_slot_assign change slot type
Hi,
It seems that R_do_slot_assign can change the type of an S4 class slot.
For example I have a class
setClass("ostream", representation(id = "integer", keepOpen =
"logical"))
and inside a C-function I was able to assign a RAW vector to the id
slot. Is this intentional? I remember reading somewhere that the slot
type is guaranteed by R. Maybe this doesn't
Unnecessary extra copy with matrix(..., dimnames=NULL) (Was: Re: modifying large R objects in place)
2007 Sep 27
0
Unnecessary extra copy with matrix(..., dimnames=NULL) (Was: Re: modifying large R objects in place)
As others already mentioned, in your example you are first creating an
integer matrix and the coercing it to a double matrix by assigning
(double) 1 to element [1,1]. However, even when correcting for this
mistake, there is an extra copy created when using matrix().
Try this in a fresh vanilla R session:
> print(gc())
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 136684 3.7
2006 Nov 17
2
Data table in C
After getting one list done, I am now struggling to form a data frame in C.
I tried to do a list of lists which gives me :
$<NA>
$<NA>[[1]]
[1] "BID"
$<NA>[[2]]
[1] 0.6718
$<NA>[[3]]
[1] 3e+06
$<NA>
$<NA>[[1]]
[1] "BID"
$<NA>[[2]]
[1] 0.6717
$<NA>[[3]]
[1] 5e+06
$<NA>
$<NA>[[1]]
[1] "BID"
2004 Jan 16
1
feature request: multi-language support
Could it be possible for packages to have manuals in multiple
languages?
I'm not saying all manuals should be in multiple languages, but
I think there should be a mechanism for package writers to add
manuals in multiple languages, if they think it useful.
--
Peter Kleiweg
2004 Aug 18
3
R as shared library
Hello folks,
I'm embarking on a project to embed R into the Apache web server, and
I'd like your help. Currently, I'm looking for a way for R code to call
back into a shared library from which the R shared library was loaded.
Essentially, apache starts and loads mod_R.so which runs an
initialization routine which calls Rf_initEmbeddedR() and the following
code:
/* override to
2005 Jul 04
2
Compiling R scripts
Dear R Developers,
A recommendation for future development.
It would help if R scripts could be compiled into an executable, or a library. Speed is the main issue (I run a large scale monte carlo in R which is very slow). However, it would also make it easier to link R into other applications, easier at least than the COM infrastructure under Windows.
Finally, it would make it much easier to
2004 Mar 22
3
Distributed computing
Dear all,
does anyone know if there exists an effort to bring some kind of
distributed computing to R? The most simple functionality I'm after is
to be able to explicitly perform a task on a computing server. Sorry if
this is a non-informed newbie question...
Best regards
Anders Sj?gren
PhD Student
Dept. of Mathematical Statistics
Chalmers University of Technology
Gothenburg, Sweden