Re: [Rd] can one modify array in R memory from C++ without copying it?

2011-11-01 Thread Simon Urbanek
ects: > library(inline) > foo = cfunction(signature(x="integer"), "INTEGER(x)[0]=1; return x;") > a=0L > b=a > foo(a) [1] 1 > a [1] 1 > b [1] 1 As you can see "b" is modified even though it was not involved in the call at all! Tracing such issues can be a nightmare, so the answer is "you don't want to do it". Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Static R Build

2011-11-04 Thread Simon Urbanek
u must make sure they are PIC since they will be used from shared objects: packages). Alternative route is to put dependent shared objects into $R_HOME/lib - that's in fact by far the easiest. Cheers, Simon > Thank you for your help, > Michael > > __

Re: [Rd] Question on parsing R code from C

2011-11-08 Thread Simon Urbanek
t embedding, it has examples. Also see the other R GUIs to understand the complexities involved. BTW: you subject has absolutely nothing to do with your question - your'e asking about embedding R ;) Cheers, Simon > > Any help or feedback is appreciated. > > Thank you.

Re: [Rd] Question on parsing R code from C

2011-11-08 Thread Simon Urbanek
On Nov 8, 2011, at 4:57 PM, KR wrote: > Simon Urbanek r-project.org> writes: >> I'm not sure I understand this really - it doesn't define SEXP. I would >> expect > something like >> >> typedef void *SEXP; >> >> Which may work fo

Re: [Rd] Question on parsing R code from C

2011-11-08 Thread Simon Urbanek
On Nov 8, 2011, at 6:53 PM, KR wrote: > Simon Urbanek r-project.org> writes: >> Except that you don't know what are macros, inlined functions and actual > functions. If you are careful you >> can possibly fall back to external functions but, obviously, your code wil

Re: [Rd] Question on parsing R code from C

2011-11-11 Thread Simon Urbanek
a double? > Because the constants 1, 2 and 3 are all doubles. For example 1L is an integer and "1" is a string. BTW: you are asking a lot of questions the are answered in the Rserve FAQ (since what you do is exactly what Rserve provides) so you may want to have a quick look: http:

Re: [Rd] Question on parsing R code from C

2011-11-11 Thread Simon Urbanek
On Nov 11, 2011, at 10:08 AM, Simon Urbanek wrote: > > On Nov 10, 2011, at 6:24 PM, KR wrote: > >> First of all thanks a lot to you both for all the replies, they have been of >> great help to me! >> >> I got the basic embedding running, however I still

Re: [Rd] Including multiple third party libraries in an extension

2011-11-12 Thread Simon Urbanek
ies of the src directories whereas the presence of configure allows you to treat your package as one architecture at a time and you can pass-though parameters). Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Including multiple third party libraries in an extension

2011-11-13 Thread Simon Urbanek
Tyler, On Nov 12, 2011, at 11:08 PM, Tyler Pirtle wrote: > Thanks Simon, a few replies... > > On Sat, Nov 12, 2011 at 6:14 AM, Simon Urbanek > wrote: > Tyler, > > On Nov 11, 2011, at 7:55 PM, Tyler Pirtle wrote: > > > Hi, > > > > I&#x

Re: [Rd] Including multiple third party libraries in an extension

2011-11-13 Thread Simon Urbanek
On Nov 13, 2011, at 6:48 PM, Tyler Pirtle wrote: > > > On Sun, Nov 13, 2011 at 7:27 AM, Uwe Ligges > wrote: > > > On 13.11.2011 05:22, Tyler Pirtle wrote: > On Sat, Nov 12, 2011 at 8:08 PM, Tyler Pirtle wrote: > > Thanks Simon, a few replies... > > On

Re: [Rd] Including multiple third party libraries in an extension

2011-11-14 Thread Simon Urbanek
On Nov 13, 2011, at 9:55 PM, Tyler Pirtle wrote: > > > On Sun, Nov 13, 2011 at 6:25 PM, Simon Urbanek > wrote: > > On Nov 13, 2011, at 6:48 PM, Tyler Pirtle wrote: > > > > > > > On Sun, Nov 13, 2011 at 7:27 AM, Uwe Ligges > > wrote: > &

Re: [Rd] Question on parsing R code from C

2011-11-15 Thread Simon Urbanek
On Nov 15, 2011, at 5:39 PM, KR wrote: > Simon Urbanek r-project.org> writes: >> AFAIR you have to evaluate parse(text=...) for that, there is no C-level > access to parser errors. > > Yes that did it, thanks! > >> If you get a crash, you're not setting

Re: [Rd] Question on parsing R code from C

2011-11-16 Thread Simon Urbanek
On Nov 16, 2011, at 2:48 PM, KR wrote: > Simon Urbanek r-project.org> writes: >> Not without seeing the actual code. (And details such as which platform >> you're > on). >> Note that setup_Rmainloop() is the last to set the SETJMP context target so >

Re: [Rd] round() ignores missing arguments if it is used inside another function where some arguments are missing.

2011-11-18 Thread Simon Urbanek
On Nov 18, 2011, at 10:43 AM, Joris Meys wrote: > I have stumbled across some behaviour in R that I really can't place, > and that makes coding a bit tricky. I know that I can work around it > when explicitly checking for missing arguments, but still... > I have two functions. I have a first func

Re: [Rd] Non-free packages in CRAN

2011-11-18 Thread Simon Urbanek
choose to abandon the free software and use a commercial product instead (AFAIR in your example it was Matlab that has a link to Mosek). That would also weaken the possibility of a free alternative for the package. Cheers, Simon On Nov 17, 2011, at 1:06 PM, Jordi Gutiérrez Hermoso wrote: > H

Re: [Rd] testing on platforms, was Fortran error

2011-11-21 Thread Simon Urbanek
thus reluctant to perform builds on my own systems for packages that have no source provenance (i.e. if I don't have an accountable registered user) - for security reasons. Cheers, Simon > Best, > > JN > > On 11/21/2011 06:00 AM, r-devel-requ...@r-project.org wrote

Re: [Rd] gsub, utf-8 replacements and the C-locale

2011-11-23 Thread Simon Urbanek
ith happens now). The relevant code is somewhat convoluted (and more so in R-devel) so I'm not volunteering to do it, though. Just to make things more clear - the current result (in C locale): > gsub(" ","\ua0", "foo bar") [1] "foo\302\240bar" Possibly desired result: > gsub(" ","\ua0", "foo bar") [1] "foobar" Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] capture.output(eval(..., envir)) not evaluate in the expected(?) environment

2011-11-23 Thread Simon Urbanek
IMHO this has nothing to do with capture.output() per se - it's simply lazy evaluation that gets you. Add force(envir) before capture.output and it works as you expected - the parent.frame() will be different inside capture.output than outside. Cheers, Simon On Nov 23, 2011, at 9:

Re: [Rd] capture.output(eval(..., envir)) not evaluate in the expected(?) environment

2011-11-24 Thread Simon Urbanek
he point that it is what is causing it. A more simple example illustrating what happens here: > f = function(e=parent.frame()) local(print(e)) > f() > f = function(e=parent.frame()) { force(e); local(print(e)) } > f() > f = function(e=parent.frame()) if (is.environment(e)) local(

Re: [Rd] Confused about NAMED

2011-11-24 Thread Simon Urbanek
n invoke user code inside it anyway > then. > > Since list() is primitive I tried to construct a data.frame starting with > list() [since structure() isn't primitive], but then merely adding an > attribute seems to set NAMED==2 too ? > Yes, because attr(x,y) <- z is the s

Re: [Rd] Confused about NAMED

2011-11-24 Thread Simon Urbanek
On Nov 24, 2011, at 1:48 PM, Prof Brian Ripley wrote: > On Thu, 24 Nov 2011, Simon Urbanek wrote: > >> >> On Nov 24, 2011, at 8:05 AM, Matthew Dowle wrote: >> >>>> >>>> On Nov 24, 2011, at 12:34 , Matthew Dowle wrote: >>>> &g

Re: [Rd] error starting R-devel with --arch ppc -- "an unusual circumstance has arisen"

2011-12-15 Thread Simon Urbanek
rectory is old and the resulting tar ball is not updated. I'll keep you posted. Cheers, Simon On Dec 15, 2011, at 4:56 PM, Dan Tenenbaum wrote: > When I try and start R-devel as follows: > > R --vanilla --arch ppc > > I see this, over and over again, ^C does not interrup

Re: [Rd] secure password token management method in R

2011-12-18 Thread Simon Urbanek
n-disk) and possibly the gnome API as well. Cheers, Simon On Dec 18, 2011, at 9:03 AM, Barry Rowlingson wrote: > On Sun, Dec 18, 2011 at 1:28 AM, Paul Gilbert wrote: >> One way this is often done is to have this information in a file that only >> the owner can read. For exa

Re: [Rd] Saving nothing with save()

2011-12-19 Thread Simon Urbanek
rn or stop - personally I prefer former) and not anything else. > e.g., in the case of save.image() when there's nothing to save. > Why should save.image() warn? Again, it causes unnecessary trouble for automated saving... empty workspace is probably even more common that using sa

Re: [Rd] Issues with building package with C src on windows [R CMD INSTALL ignoring makefile]

2011-12-19 Thread Simon Urbanek
.win Note that in most cases it is unnecessary to use Makefile - you can add targets to Makevars which will supply you with the correct flags and give you flexibility whereas Makefile is very limited in that you need to write all rules by hand which is very error prone and likely to break with new R ver

Re: [Rd] error starting R-devel with --arch ppc -- "an unusual circumstance has arisen"

2011-12-19 Thread Simon Urbanek
On Dec 19, 2011, at 2:22 PM, Dan Tenenbaum wrote: > On Thu, Dec 15, 2011 at 4:46 PM, Simon Urbanek > wrote: >> Dan, >> >> I don't know why, but something is off in the recent R-devel build for ppc. >> The result is that the installed binary ppc is older tha

Re: [Rd] external pointers

2011-12-28 Thread Simon Urbanek
rt of the equivalent of using the restricted set of objects to evaluate R function (so you still can't pass your pointer). As the docs say there is no point in using it in modern code. Cheers, Simon > Any suggestions appreciated. > > Thanks, Patrick > > [[alternati

Re: [Rd] Subsetting a data frame vs. subsetting the columns

2011-12-28 Thread Simon Urbanek
Hadley, there was a whole discussion about subsetting and subassigning data frames (and general efficiency issues) some time ago (I can't find it in a hurry but others might) -- just look at the `[.data.frame` code to see why it's so slow. It would need to be pushed into C code to allow certain

Re: [Rd] returning information from functions via attributes rather than return list

2012-01-03 Thread Simon Urbanek
ur subclass (e.g. m$myItem1, m$myItem2, ...), prepend your new subclass name and you're done. You can still dispatch on your subclass before the superclass while superclass methods just work as well.. Cheers, Simon > I either need to write > custom methods for every function or r

Re: [Rd] serializing recordedplot object

2012-01-10 Thread Simon Urbanek
On Jan 10, 2012, at 1:06 AM, Jeroen Ooms wrote: > The underlying problem turns out to be serialization of objects of > class "NativeSymbolInfo". When these are serialized and unserialized, > the memory address turns into a nullpointer, causing the fail. To fix > it, one can simply create new nati

Re: [Rd] serializing recordedplot object

2012-01-10 Thread Simon Urbanek
On Jan 10, 2012, at 4:12 PM, Jeroen Ooms wrote: > On Tue, Jan 10, 2012 at 6:17 AM, Simon Urbanek > wrote: >> Unfortunately R doesn't provide a way for this. Without changes to >> unserialization (on the wishlist for a few years now, but not easy to >> design) th

Re: [Rd] Changed behaviour of 'R CMD INSTALL'

2012-01-11 Thread Simon Urbanek
try --no-multiarch On Jan 11, 2012, at 8:16 AM, Berwin A Turlach wrote: > G'day all, > > I found the following snippet in the NEWS file for R 2.14.1: > >• R CMD INSTALL will now do a test load for all sub-architectures > for which code was compiled (rather than just the primary >

Re: [Rd] Copying objects prior to .Call

2012-01-11 Thread Simon Urbanek
- .Call does *NOT* have a DUP argument - you are responsible for duplication at all times if you make modifications (e.g. using duplicate()). Cheers, Simon > A simple example > is: > >> x <- 2 >> y <- x >> .Call("addOne", x, DUP=TRUE) # Changing DUP do

Re: [Rd] Copying objects prior to .Call

2012-01-11 Thread Simon Urbanek
On Jan 11, 2012, at 1:04 PM, Uwe Ligges wrote: > > > On 11.01.2012 18:49, Simon Urbanek wrote: >> >> On Jan 11, 2012, at 12:08 PM, Taylor Arnold wrote: >> >>> R-devel, >>> >>> I have noticed that making a copy of an object in R prior t

Re: [Rd] names<- appears to copy 3 times?

2012-01-17 Thread Simon Urbanek
0x100c82778]: tracemem[0x100c82778 -> 0x100c712b0]: and as we discussed here earlier, using the assignment primitive directly makes just one copy: > DF = data.frame(a=1:3,b=4:6) > tracemem(DF) [1] "<0x1029a3c68>" > n = names(DF) > n[2]="B" > DF = `names<-`(DF, n) tracemem[0x1029a3c68 -> 0x1029a3b18]: Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] png cairo device problems on Mac 10.6.8

2012-01-18 Thread Simon Urbanek
a similar note type="cairo-png" works as well. The problem seems to be with R's configuration - for some mysterious reason it picks libpng12 flags even though cairo clearly includes libpng15 (and so does pkg-config). I'll need to dig a bit into that. Cheers, Simon > W

Re: [Rd] use of UTF-8 \uxxxx escape sequences in function arguments

2012-01-19 Thread Simon Urbanek
e all non- > ASCII characters in my UTF-8 encoded R files with: > > iconv -f UTF-8 -t ASCII --unicode-subst="\u%04X" my-utf-8-encoded-file.R > You can actually do that with R alone: ## you'll have to make sure that you're in C locale

Re: [Rd] use of UTF-8 \uxxxx escape sequences in function arguments

2012-01-19 Thread Simon Urbanek
On Jan 19, 2012, at 7:27 PM, Jeroen Ooms wrote: >> >> I installed "libiconv" from http://www.gnu.org/software/libiconv/, and >> now I can easily replace all non- ASCII characters in my UTF-8 encoded R >> files with: iconv -f UTF-8 -t ASCII --unicode-subst="\u%04X" >> my-utf-8-encoded-file.R > >

Re: [Rd] tcltk GUIs (was need gui matrix editor: does R Core team have advice on how?)

2012-01-29 Thread Simon Urbanek
support some kind of graphical interface but I would certainly not recommend it as a GUI toolkit. My interpretation is that its presence in R is purely historical (it was an option that someone wrote code for at the time). That said, given the lack of choices, a lot of code was based on it. No

Re: [Rd] location of check.Renviron on Windows

2012-02-01 Thread Simon Urbanek
On Feb 1, 2012, at 2:10 PM, Robert M. Flight wrote: > Doing package development on a Windows 7 machine, and I want to tell R > check not to worry about the "suggested" packages. > > I realize this can be done using the ~/.R/check.Renviron file, but > what directory corresponds to "~"? Is that su

Re: [Rd] Is the link to the R wiki down?

2012-02-03 Thread Simon Urbanek
r correctly run by Philippe Grosjean. The actual URL seems to work http://rwiki.sciviews.org/ Cheers, Simon > Best, > Tal > > > Contact > Details:--- > Contact me: tal.gal...@gmail.com | 972-52-7275845

Re: [Rd] Segfault on ".C" registration via R_CMethodDef according to 'Writing R Extensions'.

2012-02-06 Thread Simon Urbanek
object (it has to because "types" is a pointer, not a fixed array) - so the effect is the same as using a static object. Cheers, Simon On Feb 6, 2012, at 8:27 AM, Daniel Adler wrote: > Dear R List, > > I encountered a serious problem regarding the registration of ".C&quo

Re: [Rd] Canonical package directory name for JAR files?

2012-02-07 Thread Simon Urbanek
On Feb 7, 2012, at 4:34 PM, Roebuck,Paul L wrote: > We have an R package which needs to include a JAR file. > Is there a canonical directory for it? > rJava defines "java" for that purpose (see ?.jpackage). How canonical that is may be open for debate

Re: [Rd] Canonical package directory name for JAR files?

2012-02-08 Thread Simon Urbanek
s pkg/jars to the CLASSPATH so .Java calls > will find it. > > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > >> -Original Message- >> From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] >> On Behalf Of Roebuc

Re: [Rd] Canonical package directory name for JAR files?

2012-02-08 Thread Simon Urbanek
it's not our fault. In addition, I think it is a bad idea to mix up the directories as S+ does. Cheers, Simon > > On 2/8/12 4:12 PM, "William Dunlap" wrote: > >> We don't "mandate" a given JDK (including the compiler, >> javac), but w

Re: [Rd] FORTRAN compilation error

2012-02-08 Thread Simon Urbanek
so there is not much we can help you with ... You should remove the offending Makeconf to start with ... Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] FORTRAN compilation error

2012-02-09 Thread Simon Urbanek
lking about R Makeconf, but the one in your package (in src). What are your settings there? And what are the files? Thanks, Simon > Dave > > #-*- Makefile -*- > # $(R_HOME}/etc$(R_ARCH)/Makeconf > > # Hand-edited version for gnuwin32. > > ifdef DEBUG > DLLFLAG

Re: [Rd] FORTRAN compilation error

2012-02-09 Thread Simon Urbanek
David, On Feb 9, 2012, at 10:48 AM, David L Lorenz wrote: > > Simon, > It was not clear that I needed any makefiles in src. I have seen no > documentation anywhere that I needed a makefile in src. You don't - I thought you are using one to modify the object list. Simple

Re: [Rd] include

2012-02-19 Thread Simon Urbanek
st add targets). But your immediate problem is that you want to use R CMD SHLIB $(SRC) and not $(OBJS), otherwise you'll be missing all C*FLAGS (which includes -I that is needed for the headers) since the compilation will be done by your Makefile and not R. Cheers, Simon

Re: [Rd] include

2012-02-19 Thread Simon Urbanek
Paul, On Feb 19, 2012, at 9:32 PM, Paul Gilbert wrote: > On 12-02-19 04:56 PM, Simon Urbanek wrote: >> Paul, >> >> On Feb 19, 2012, at 2:45 PM, Paul Gilbert wrote: >> >>> I am trying to add >>> >>> #include >>> >>

Re: [Rd] tempdir() documentation or real bug ?

2012-02-21 Thread Simon Urbanek
temporary directory is determined at R startup: $ TMPDIR=/Users/urbanek R --slave -e 'print(tempdir())' [1] "/Users/urbanek/RtmpDee89D" Cheers, Simon >> Sys.setenv(TMPDIR='/home/brian/') >> Sys.getenv('TMPDIR') > [1] "/home/brian/&

Re: [Rd] Replace back slashes with forward slashes?

2012-02-29 Thread Simon Urbanek
UE) Where x is the character string (and I suppose you are aware of it since you are using it below). The rest of this e-mail makes absolutely no sense to me -- what exactly are you taking about? What else do you want to achieve? Cheers, Simon > Several years ago, Prof. Ripley

Re: [Rd] Replace back slashes with forward slashes?

2012-02-29 Thread Simon Urbanek
On Feb 29, 2012, at 1:19 PM, Spencer Graves wrote: > Hi, Simon: > > On 2/29/2012 10:04 AM, Simon Urbanek wrote: >> On Feb 29, 2012, at 12:37 PM, Spencer Graves wrote: >> >>> Hello, All: >>> >>> >>> What can people tell me

Re: [Rd] print method for summary adds trailing zero

2012-03-02 Thread Simon Urbanek
mmary(vec) Min. 1st Qu. MedianMean 3rd Qu.Max. 768000 966000 1053000 1048000 1107000 1316000 > max(vec) [1] 1315985 That's the point at which you decide never to use summary() again ;). Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] hash table clean-up

2012-03-04 Thread Simon Urbanek
On Mar 4, 2012, at 4:40 PM, Gabor Grothendieck wrote: > On Sun, Mar 4, 2012 at 4:19 PM, wrote: >> On Sun, 4 Mar 2012, Florent D. wrote: >> >>> Hello, >>> >>> I have noticed that the memory usage inside an R session increases as >>> more and more objects with unique names are created, even aft

Re: [Rd] malloc/calloc/strdup and R's aequivalents

2012-03-17 Thread Simon Urbanek
aly? > And at which time? > In the docs is mentioned, at the end of the .C/.Call/.External call. > Does this mean, this is freed/reclaimed automatically, when returning > from the C-world to the R-world? > At (after) return of the extension's co

Re: [Rd] R's copying of arguments (Re: Julia)

2012-03-21 Thread Simon Urbanek
ing DUP=FALSE is dangerous (see Warning > section in the man page). > > No need to switch to .Call > I strongly disagree. I'm appalled to see that sentence here. The overhead is significant for any large vector and it is in particular unnecessary since in .C you have to allocate

Re: [Rd] R's copying of arguments (Re: Julia)

2012-03-21 Thread Simon Urbanek
On Mar 21, 2012, at 9:31 PM, Hervé Pagès wrote: > On 03/21/2012 06:23 PM, Simon Urbanek wrote: >> >> On Mar 20, 2012, at 3:08 PM, Hervé Pagès wrote: >> >>> Hi Oliver, >>> >>> On 03/17/2012 08:35 AM, oliver wrote: >>>> Hello, >&g

Re: [Rd] R-devel Digest, Vol 109, Issue 22

2012-03-22 Thread Simon Urbanek
lectures to > the "sinners of .C". (Mostly because the things I needed to know are > scattered about in multiple places.) > > I might have to ask for an exemption on that timestamp -- the first bits of > the survival package only reach back to 1986. And I've had to c

Re: [Rd] Missing Windows binary for R-2.15RC?

2012-03-24 Thread Simon Urbanek
; > If this happens again (which is pretty likely), you can manually download the > previous version by editing the URL to put in "alpha" in place of "beta", or > "beta" in place of "rc". > ... or have a fixed name instead (on OS X we just use 2.1

Re: [Rd] Missing Windows binary for R-2.15RC?

2012-03-24 Thread Simon Urbanek
On Mar 24, 2012, at 2:47 PM, Uwe Ligges wrote: > > > On 24.03.2012 19:31, Simon Urbanek wrote: >> >> On Mar 24, 2012, at 12:43 PM, Duncan Murdoch wrote: >> >>> On 12-03-24 10:53 AM, Uwe Ligges wrote: >>>> >>>> >>>>

Re: [Rd] .Call ref card

2012-03-27 Thread Simon Urbanek
On Mar 27, 2012, at 12:03 PM, Terry Therneau wrote: > On 03/23/2012 10:58 AM, Simon Urbanek wrote: >> This is my shot at a cheat sheet. >> comments are welcome. >> >> Simon >> >> > I was looking through the cheat sheet. It's nice. There are

Re: [Rd] .Call ref card

2012-03-27 Thread Simon Urbanek
-- advanced users may need a different sheet but then they just go straight to the headers anyway ... Cheers, Simon On Mar 27, 2012, at 12:20 PM, Simon Urbanek wrote: > > On Mar 27, 2012, at 12:03 PM, Terry Therneau wrote: > >> On 03/23/2012 10:58 AM, Simon Urbanek wrote: >>&

[Rd] Reference Class import() behaviour

2012-04-13 Thread Simon Potter
$view() # A workaround is to perform manual assignment b$vps <- a$vps b$gt <- a$gt b$nums <- a$nums b$view() # Desired result I'm not sure what's causing this, or whether I'm going about this in the wrong way but any assistance would be much appreciated. -- Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] C - R integration: Memory Issues

2012-04-20 Thread Simon Urbanek
difference. Likewise, you could returns bers as well. Or free >> it. Right now I am not entirely what it is that your 'prediction' function is >> trying to do. > > It is actually a more complex function with many more allocations and > R_tryEval calls; the si

Re: [Rd] Problem with args

2012-04-21 Thread Simon Urbanek
On Apr 21, 2012, at 1:03 PM, Gabor Grothendieck wrote: > args ought to check that its argument is a function: > >> max <- 3 >> args(max) > NULL > > e.g. > >> args <- function(name) { > + name <- match.fun(name) > + base::args(name) > + } >> args(max) > function (..., na.rm = FALSE) > N

Re: [Rd] Problem with args

2012-04-21 Thread Simon Urbanek
On Apr 21, 2012, at 1:45 PM, Gabor Grothendieck wrote: > On Sat, Apr 21, 2012 at 1:38 PM, Simon Urbanek > wrote: >> >> On Apr 21, 2012, at 1:03 PM, Gabor Grothendieck wrote: >> >>> args ought to check that its argument is a function: >>> >>

Re: [Rd] delayedAssign changing values

2012-04-26 Thread Simon Urbanek
or just a good way to write extremely obfuscated code? > That is a good question and I don't know the answer. The docs don't say which value will be fixed so it could be either way, but intuitively I would expect the promise evaluation to override side-effects. Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] delayedAssign changing values

2012-04-26 Thread Simon Urbanek
oint here is to access lazy evaluation which is exactly what it does - lazy evaluation takes place in the original environment, not in another one. Cheers, Simon > Michael > > -- > View this message in context: > http://r.789695.n4.nabble.com/delayedAssign-changing-values-tp4588108p459

Re: [Rd] Creating a package which contains stand-alone C code

2012-04-28 Thread Simon Urbanek
; } and PKG_CPPFLAGS=-Dmain=prog_main make sure you re-map main for the package in case it conflicts with R. In general, you can do better and pass your data directly -- just define some interface in your program -- it will be much more efficient than going through files. Then your main() for the s

Re: [Rd] fast version of split.data.frame or conversion from data.frame to list of its rows

2012-05-01 Thread Simon Urbanek
hink you are misunderstanding data frames - t() makes no sense for data frames. Cheers, Simon > On Tue, May 1, 2012 at 5:46 AM, Prof Brian Ripley > wrote: > >> On 01/05/2012 00:28, Antonio Piccolboni wrote: >> >>> Hi, >>> I was wondering if there is anythin

Re: [Rd] loading multiple CSV files into a single data frame

2012-05-03 Thread Simon Urbanek
On May 3, 2012, at 5:40 PM, victor jimenez wrote: > First of all, thank you for the answers. I did not know about zoo. However, > it seems that none approach can do what I exactly want (please, correct me > if I am wrong). > > Probably, it was not clear in my original question. The CSV files onl

Re: [Rd] f951.exe: sorry, unimplemented: 64-bit mode not compiled

2012-05-04 Thread Simon Urbanek
you're using the wrong (old) compiler. The new MinGW compilers support both -m32 and -m64. You have to set the PATH to the new compilers (in the gcc-4.6.3 subdirectory of Rtools) *before* any old compilers in Rtools. Cheers, Simon > make: *** [bispev.o] Error 1 > gfortran -m64 -O2

Re: [Rd] looking for adice on bigmemory framework with C++ and java interoperability

2012-05-04 Thread Simon Urbanek
) so they are trivially readable/writable from both C++ (just read into memory and cast to the array type) and Java (e.g, DoubleBuffer view on a ByteBuffer). So the question is what exactly is the problem? Cheers, Simon > Best > Andre > > NB. I guess something like what i want -- ac

Re: [Rd] How to list package dependency on a Bioconductor package?

2012-05-08 Thread Simon Urbanek
nd on it, it should certainly not be in Depends. But that is a design decision (depending on packages outside CRAN is somewhat tricky because in general you cannot guarantee availability, but it is legal ;)). If you need any additional non-CRAN dependencies on Mac OS X, they can be installed

Re: [Rd] How to list package dependency on a Bioconductor package?

2012-05-08 Thread Simon Urbanek
On May 8, 2012, at 11:56 AM, Martin Morgan wrote: > On 5/8/2012 8:44 AM, Simon Urbanek wrote: >> Steven, >> >> On May 7, 2012, at 1:24 PM, Steven Lund wrote: >> >>> I recently submit a package called QuasiSeq. The package source and >>> Windo

Re: [Rd] R CMD check linking errors, when interfacing c++

2012-05-09 Thread Simon Urbanek
't know what am I doing wrong. > > More suprising, when I run the same package in windows with R CMD check, > the dll for src-i386 was created, but not the 64 -bit, i'm getting: sorry, > 64 bit compilation not supported (or someting similar) > You have the wrong to

Re: [Rd] setting global options for a package

2012-05-10 Thread Simon Urbanek
uot;darkcyan","magenta", > "brown","darkgray")) You certainly don't want to do that - it would override user's setting and thus defeat the whole purpose of options. > } > > My function could then use > > foo <- function(x, getOption

Re: [Rd] r-devel fails tests for parallel

2012-05-17 Thread Simon Urbanek
th old GCC > releases for GPL3 reasons should really migrate to clang / llvm. > The problem is that unfortunately clang is too incomplete for that -- it lacks Fortran and OpenMP support - both are quite important for R so migrating to clang is not realistic so far. Cheers, Simon ___

Re: [Rd] Distributing Executables.

2012-05-18 Thread Simon Urbanek
are rules for *source* packages which can't distribute binaries, but you can always use a binary package (which contains binaries). Note that the issue in question is not who built the binary but whether it could have been injected by 3rd party or not (hence all binaries are disallow

Re: [Rd] Distributing Executables.

2012-05-18 Thread Simon Urbanek
On May 18, 2012, at 11:32 AM, Daniel Fuka wrote: > Thanks Simon, > > In this case, I am talking specifically about allowing CRAN to compile > source into an executable to be distributed, as discussed in the > second paragraphs "very special cases .. for example executable &

Re: [Rd] Best way to locate R executable from within R?

2012-05-22 Thread Simon Urbanek
On May 22, 2012, at 1:47 PM, Dan Tenenbaum wrote: > On Tue, May 22, 2012 at 10:34 AM, Henrik Bengtsson > wrote: >> Hi, >> >> I'd like to spawn of a new R process from within R using system(), >> e.g. system("R -f myScript.R"). However, just specifying "R" as in >> that example is not guarante

Re: [Rd] Best way to locate R executable from within R?

2012-05-22 Thread Simon Urbanek
"), R.version$arch, R) > Typically, when you want another subprocess of R it is not the same as the process you're in - e.g. you certainly don't want to use Rgui to run a script, so the above is not useful for Henrik's purpose. Besides, it won't even work s

Re: [Rd] Capturing signals from within external libs

2012-05-22 Thread Simon Urbanek
o mess with interrupts since your library code will run separately from R. The downside is that you need to mess with threads which may or may not be an issue depending on the complexity of your code and whether you want it to be cross-platform or not. Cheers, Simon Example code: #include #incl

Re: [Rd] Best way to locate R executable from within R?

2012-05-22 Thread Simon Urbanek
On May 22, 2012, at 3:34 PM, Gabor Grothendieck wrote: > On Tue, May 22, 2012 at 3:28 PM, Gabor Grothendieck > wrote: >> On Tue, May 22, 2012 at 3:05 PM, Henrik Bengtsson >> wrote: >>> On Tue, May 22, 2012 at 11:39 AM, Gabor Grothendieck >>> wrote: On Tue, May 22, 2012 at 1:34 PM, Henrik

Re: [Rd] Best way to locate R executable from within R?

2012-05-22 Thread Simon Urbanek
I think the most reliable solution is something like system(paste(shQuote(file.path(R.home("bin"),"R")), ...)) it supports spaces in paths and works both on unix and Windows, picking the proper architecture. Cheers, Simon On May 22, 2012, at 3:05 PM, Henrik Bengtsson w

Re: [Rd] Best way to locate R executable from within R?

2012-05-22 Thread Simon Urbanek
On May 22, 2012, at 7:37 PM, Gabor Grothendieck wrote: > On Tue, May 22, 2012 at 6:04 PM, Simon Urbanek > wrote: >> >> On May 22, 2012, at 3:34 PM, Gabor Grothendieck wrote: >> >>> On Tue, May 22, 2012 at 3:28 PM, Gabor Grothendieck >>> wrote: &g

Re: [Rd] Capturing signals from within external libs

2012-05-23 Thread Simon Urbanek
On May 23, 2012, at 12:40 PM, Jeffrey Ryan wrote: > Simon, > > Thanks for the clarifying example. I fear my current set up fails the > test for 'no R calls', Well, but in that case you already have interrupt points so I'm not sure what is the problem? I thought

Re: [Rd] modifying some package code

2012-05-24 Thread Simon Urbanek
?getNativeSymbolInfo) and is defined by R_registerRoutines in src/init.c. This is a typical optimization in R packages to avoid costly lookup of symbols and to provide check for native arguments. Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] modifying some package code

2012-05-24 Thread Simon Urbanek
On May 24, 2012, at 1:26 PM, Charles Determan Jr wrote: > Simon, > > Thank you for this valuable information. However, you must forgive some > ignorance on my part. If R-registerRoutines defines the native function, how > should I go about fixing this issue? Would I copy th

Re: [Rd] [patch] Behavior of .C() and .Fortran() when given double(0) or integer(0).

2012-05-26 Thread Simon Urbanek
o it is much safer to check that the length you passed is 0 rather than relying on special-casing into NULL pointers. Cheers, Simon > Also, while the .Call() interface > allows an R vector passed to it to be resized, the .C() and .Fortran() > interfaces don't, so a 0-length R vecto

Re: [Rd] fractional seconds in POSIXct

2012-05-30 Thread Simon Urbanek
:%M:%OS5") [1] "20/09/2011 13:00:59.0" "20/09/2011 13:00:59.01999" "20/09/2011 13:00:59.03999" > format(t, "%d/%m/%Y %H:%M:%OS2") [1] "20/09/2011 13:00:59.00" "20/09/2011 13:00:59.01" "20/09/2011 13:00:59.03" If yo

Re: [Rd] length-0 list as dimnames

2012-06-05 Thread Simon Urbanek
e example above? > No, from the docs: The replacement method for arrays/matrices coerces vector and factor elements of ‘value’ to character, but does not dispatch methods for ‘as.character’. It coerces zero-length elements to ‘NULL’, and a zero-length list to ‘NULL’. you

Re: [Rd] problem in compililng c code using R CMD SHLIB

2012-06-06 Thread Simon Urbanek
in that it prefers different path style, but it's perfectly ok and doesn't affect anything. So what exactly is the problem you're having? Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] suggest that as.double( something double ) not make a copy

2012-06-06 Thread Simon Urbanek
(0,2,2) > tracemem(x) [1] "<0x100b0f098>" > as.double(x) tracemem[0x100b0f098 -> 0x1008b52c8]: [1] 0 0 0 0 That is not the fault of as.double() but rather of the user since you don't really need to strip attributes when calling .C as it doesn't care. As

Re: [Rd] 7 arguments passed to .Internal(identical) which requires 6

2012-06-07 Thread Simon Urbanek
c to the major.minor version, we don't guarantee any compatibility across non-patch versions, i.e. you cannot expect package binary for R 2.15.0 to work in R 2.14.2 or vice versa. If you have R x.y.z then you are asking for binaries for R x.y.* - in your case you're running 2.14.2 so you get the latest build of the package for R 2.14.*. Have a look at CRAN, e.g. http://cran.r-project.org/bin/windows/contrib/ you will see separate packages for every x.y version of R. Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Lack of -O2 (or -O) gcc compiler flag causes package installation failure

2012-06-07 Thread Simon Urbanek
the "regular" flags are taken from R. Providing the source of package.tar.gz would give us more insight on what you're actually doing - I suspect that the problem is in you breaking the build system and not in the optimization flags ... Cheers, Simon > ... compi

Re: [Rd] Multiple sub-architecture: linking issue

2012-06-08 Thread Simon Urbanek
Make sure you have installed multilib gcc and the ia32 dev packages - it seems you don't have them. I'm a Sent from my iPhone On Jun 8, 2012, at 6:27 AM, Renaud Gaujoux wrote: > Hi again, > > following my previous post on RCurl, I cannot install Rcpp either: > > g++ -m32 -I/home/renaud/bin/

Re: [Rd] Multiple sub-architecture: linking issue

2012-06-08 Thread Simon Urbanek
R doesn't use C++ nor the other libraries so you wouldn't find out about such missing pieces. Unfortunately I'm traveling w/o computer today so I can't look up what you need. If someone doesn't beat me to it I'll have a look when I get back. Simon Sent from my iP

Re: [Rd] Multiple sub-architecture: linking issue

2012-06-10 Thread Simon Urbanek
for all libraries since only a subset is available, but all the basic ones) -- there were shakeups in Ubuntu which were messing with the multilib support, so I don't know the current status but I can check at work tomorrow (probably not for something as ancient as natty, though). Ch

<    3   4   5   6   7   8   9   10   11   12   >