Re: [Rd] large integer values

2014-05-14 Thread Simon Urbanek
On May 14, 2014, at 8:41 AM, Adrian Dușa wrote: > Dear Prof. Ripley, > > Once again, thank you for your replies. > I must confess not being a genuine C programmer, having learned how to use > C only in connection to R (and the macros provided are almost a separate > language to learn). > > I'll

Re: [Rd] environment question

2014-05-17 Thread Simon Urbanek
On May 17, 2014, at 7:26 PM, Mick Jordan wrote: > On 5/17/14, 4:00 PM, peter dalgaard wrote: >> On 17 May 2014, at 19:42 , Mick Jordan wrote: >> >>> According to >>> :https://stat.ethz.ch/R-manual/R-devel/library/base/html/environment.html >>> >>> "If |fun| is a function or a formula then |env

Re: [Rd] issue with parallel package

2014-05-21 Thread Simon Urbanek
On May 21, 2014, at 1:47 PM, Jeroen Ooms wrote: > On Wed, May 21, 2014 at 10:17 AM, Josef Leydold > wrote: > I ran into an issue with the parallel package in R-3.1.0. > > I have been experiencing a very similar issue within the RAppArmor package. > Here is a smaller example: > > library(par

Re: [Rd] issue with parallel package

2014-05-21 Thread Simon Urbanek
On May 21, 2014, at 1:17 PM, Josef Leydold wrote: > Dear maintainers of the parallel package, > > I ran into an issue with the parallel package in R-3.1.0. > > The following code prints the message "NULL!" quite a lot. > > library(parallel) > for (n in 1:1000) { > p <- mcparallel(sqrt(n

Re: [Rd] Excluding objects from save.image

2014-05-22 Thread Simon Urbanek
Tim, On May 21, 2014, at 9:54 PM, Tim Keitt wrote: > When dealing with object holding pointers that are only valid during a single > session, it would be convenient to exclude them from being saved with the > session image. (I am assuming that `quit` calls `save.image` before quitting > or is

Re: [Rd] Excluding objects from save.image

2014-05-22 Thread Simon Urbanek
On May 22, 2014, at 11:33 AM, Tim Keitt wrote: > On Thu, May 22, 2014 at 9:19 AM, Simon Urbanek > wrote: > Tim, > > On May 21, 2014, at 9:54 PM, Tim Keitt wrote: > > > When dealing with object holding pointers that are only valid during a > > single sess

Re: [Rd] mcmapply Core Usage

2014-05-29 Thread Simon Urbanek
Dario, yes, that is a bug, now fixed. Cheers, Simon On May 29, 2014, at 2:00 AM, Dario Strbenac wrote: > Hello, > > I have a minimal example that shows a problem I'm having with parallel > processing. > > library(parallel) > mcmapply(function(x, y) > { > print("Running") > Sys.sleep(10)

Re: [Rd] mcmapply Core Usage

2014-05-29 Thread Simon Urbanek
On May 29, 2014, at 8:04 PM, Henric Winell wrote: > Simon Urbanek skrev 2014-05-29 15:06: >> Dario, >> >> yes, that is a bug, now fixed. > > Thanks for fixing it. > > This problem was independently reported some time ago > (https://bugs.r-project.org/b

Re: [Rd] Package impute on CRAN OSX Mavericks check machine

2014-06-10 Thread Simon Urbanek
On Jun 10, 2014, at 3:30 PM, Peter Langfelder wrote: > Hello, > > would it be possible to install the Bioconductor package impute on the > machine that checks and builds binary packages for OSX 10.9 Mavericks? > Sure, done. Cheers, Simon __ R-deve

Re: [Rd] what is the current correct repos structure for mac osx binaries?

2014-06-13 Thread Simon Urbanek
On Jun 13, 2014, at 5:41 PM, Skye Bender-deMoll wrote: > Dear R-developers, > > As part of our package building process, we maintain internal CRAN-like > repositories of our packages. This has worked pretty well, but we are > running into issues with R 3.1 and OSX mavericks. > > Specificall

Re: [Rd] what is the current correct repos structure for mac osx binaries?

2014-06-16 Thread Simon Urbanek
them. Perhaps this is the > desired behavior if the mavericks binaries are not snowleopard compatible? > Yes, Mavericks build is incompatible with the Snow Leopard build, that's why there are two separate distributions and two separate repositories. Cheers, Simon > thanks again

Re: [Rd] using C code to create data frame but always return as list

2014-06-24 Thread Simon Urbanek
On Jun 24, 2014, at 9:21 AM, Romain Francois wrote: > Hi, > > Can you give us what str on the returned object gives you? > > I think you need : > > SET_OBJECT(and, 1) ; > > at the end. > SET_OBJECT should not be used by user code in normal circumstances, it is set by R automatically a

Re: [Rd] Need help on calling Head from C

2014-06-26 Thread Simon Urbanek
On Jun 25, 2014, at 11:31 PM, Sandip Nandi wrote: > Hi , > > I am trying to call head function from C . My doubt is with the parameter > n,how to pass it . > > PROTECT(dfm=lang3(install("data.frame"),df,ScalarLogical(FALSE))); > SET_TAG(CDDR(dfm), install("stringsAsFactors")) ; > SEXP res = PRO

Re: [Rd] R-3.1.1 - R CMD INSTALL problem

2014-07-25 Thread Simon Urbanek
Eduardo, On Jul 24, 2014, at 8:37 PM, Eduardo M. A. M.Mendes wrote: > Hello > > I have recently upgraded R to the newest version. Unfortunately my old > (fortran and C) R-package cannot be installed anymore (was built before R > 3.0.0: please re-install it). > > I have tried R CMD INSTALL

Re: [Rd] [R-SIG-Mac] R-3.1.1 - R CMD INSTALL problem

2014-07-25 Thread Simon Urbanek
University of Illinois > fax: 217-244-6678 Urbana, IL 61801 > > On Jul 25, 2014, at 8:14 AM, Simon Urbanek > wrote: > >> Eduardo, >> >> On Jul 24, 2014, at 8:37 PM, Eduardo M. A. M.Mendes >> wrote: >> >>>

Re: [Rd] Error when assigning value in environment which is a locked binding

2014-08-11 Thread Simon Urbanek
On Aug 10, 2014, at 10:07 PM, Winston Chang wrote: > Another oddity - even though there's an error thrown in assignment to > x$y$z, the assignment succeeds. > > x <- new.env() > x$y <- new.env() > lockEnvironment(x, bindings = TRUE) > x$y$z <- 1 > # Error in x$y$z <- 1 : cannot change value of

Re: [Rd] Why R-project source code is not on Github

2014-08-21 Thread Simon Urbanek
On Aug 21, 2014, at 6:40 AM, Marc Schwartz wrote: > On Aug 21, 2014, at 3:11 AM, Gaurav Sehrawat > wrote: > >> R-Project is missing something important in regards to its development , >> one simply can't ignore Github ,where collaboration is at it's best . >> >> OR If i am wrong is this the

Re: [Rd] Why R-project source code is not on Github

2014-08-24 Thread Simon Urbanek
On Aug 24, 2014, at 2:22 PM, Spencer Graves wrote: > On 8/24/2014 10:24 AM, Jeroen Ooms wrote: >> On Sun, Aug 24, 2014 at 1:10 PM, Gaurav Sehrawat >> wrote: >>> But never mind . Sooner or later. >> These things take time, but a lot has happened over the past years. By >> now all activity of r-

Re: [Rd] working with huge memory: single precision?

2014-08-27 Thread Simon Urbanek
Mario, On Aug 27, 2014, at 4:03 AM, Mario Emmenlauer wrote: > > Hello, > > I'm very new to R and don't know much about it yet. I would like > to develop R-programs that work with data of sizes of 10^10 - 10^11 > data points. We have very-high-memory machines with ~256 GB, but it > would signif

Re: [Rd] R, OSX, should creating SVGs request XQuartz

2014-08-27 Thread Simon Urbanek
On Aug 27, 2014, at 5:45 AM, Jonathon Love wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > hi, > > on OS X, when you try and use something which depends on X11, and you > don't have XQuartz installed, you receive an error message, it directs > you to download XQuartz, and then it

Re: [Rd] Re R CMD check checking in development version of R

2014-08-28 Thread Simon Urbanek
On Aug 27, 2014, at 6:01 PM, Gavin Simpson wrote: > On 27 August 2014 15:24, Hadley Wickham wrote: > >>> Is that the cause of these NOTEs? Is the expectation that if I am using a >>> function from a package, even a package that I have in Depends:, that I >>> have to explicitly declare these im

Re: [Rd] Can't Find Function After requireNamespace

2014-09-17 Thread Simon Urbanek
On Sep 17, 2014, at 10:00 PM, Dario Strbenac wrote: > I have a simple function : > > f <- function() > { > if(requireNamespace("ggplot2")) >qplot(Sepal.Length, Petal.Length, data = iris, color = Species) > else >message("No graphics, just text.") > } > > ggplot2 is in the Suggests fi

Re: [Rd] Can't Find Function After requireNamespace

2014-09-17 Thread Simon Urbanek
BTW: you probably also want to use requireNamespace(..., quietly=TRUE) otherwise if sort of defeats the purpose ... On Sep 17, 2014, at 10:46 PM, Simon Urbanek wrote: > > On Sep 17, 2014, at 10:00 PM, Dario Strbenac > wrote: > >> I have a simple function : >> >&

Re: [Rd] Shallow copies

2014-10-01 Thread Simon Urbanek
On Sep 30, 2014, at 5:20 PM, Matthieu Gomez wrote: > > I have a question about shallow copies in R. Since R 3.1.0, subsetting a > dataframe with respect to its columns no longer result in deep copies. This > is an amazing change in my opinion. Now, subsetting a data.frame by rows (or > subsett

Re: [Rd] mpi.h errors on Mavericks packages

2014-10-03 Thread Simon Urbanek
Daniel, On Oct 3, 2014, at 7:17 PM, Daniel Fuka wrote: > Dear mac folks, > > I have started porting a large legacy toolset maintained in windows > and heavily mpi laden so it can be used across platforms in R... so I > am building a package out of it. On this note, I am noticing that > almost a

Re: [Rd] [R logs] Help in develop a simply logs package

2014-10-13 Thread Simon Urbanek
On Oct 7, 2014, at 7:04 AM, DataK - B. THIEURMEL wrote: > > Hi, > > With the use of R in production, it is necessary to have a system of logs > effective, and light. > > Package exist as to futile.logger, but it require the additional coding of > logs. So it is thus impossible / very difficul

Re: [Rd] Holding a large number of SEXPs in C++

2014-10-17 Thread Simon Urbanek
On Oct 17, 2014, at 7:31 AM, Simon Knapp wrote: > Background: > I have an algorithm which produces a large number of small polygons (of the > spatial kind) which I would like to use within R using objects from sp. I > can't predict the exact number of polygons a-priori, the polygons will be > gr

Re: [Rd] Using a custom memory allocation function in R

2014-10-23 Thread Simon Urbanek
SO, On Oct 22, 2014, at 10:53 AM, SO User wrote: > > Heads up: I posted this question on Stackoverflow yesterday > (http://stackoverflow.com/questions/26484103/using-a-custom-memory-allocation-function-in-r). > So far I haven’t gotten a response and I thought this could be an even > better place

Re: [Rd] 'library' or 'require' call not declared from: 'rgl'

2014-10-30 Thread Simon Urbanek
> On Oct 30, 2014, at 3:11 PM, Michael Friendly wrote: > > I'm checking a new release of vcdExtra via win builder with R-devel > 2014-10-29 r66897 > and have run into a Warning I don't know how to fix. > > I have one S3 generic, mosaic3d() that uses rgl and don't want to have rgl > always loa

Re: [Rd] Holding a large number of SEXPs in C++

2014-11-03 Thread Simon Urbanek
ons; > } > > private: > PROTECT_INDEX > ir, > icr; > > SEXP > currentRegion, > regions; > }; > > > > Thanks again, > Simon Knapp > > > > CONS(newPoly, creates a new object > On Sat, Oct 18,

Re: [Rd] Unexplicable difference between 2 R installations regarding reading numbers

2014-11-03 Thread Simon Urbanek
R version. NEWS for 3.1.0: type.convert() (and hence by default read.table() returns a character vector or factor when representing a numeric input as a double would lose accuracy. Similarly for complex inputs. NEWS for 3.1.1: type.convert(), read.table() and simil

Re: [Rd] Holding a large number of SEXPs in C++

2014-11-03 Thread Simon Urbanek
er you're interfacing a foreign runtime system (language or library). What is or is not in the API can vary slightly depending on whom you ask, but the installed header files are essentially the candidate set. Cheers, Simon > Thanks again for being so awesome, > Simon > > On

Re: [Rd] Making iconv portable?

2014-12-15 Thread Simon Urbanek
> On Dec 15, 2014, at 12:21 PM, Kurt Hornik wrote: > >> Spencer Graves writes: > >> Hello, All: >>What would it take to make “iconv” portable? > > >>I ask, because I want to convert accented characters to >>vanilla ASCII, thereby converting, e.g., ‘Raúl’ to “Ra

Re: [Rd] Making iconv portable?

2014-12-15 Thread Simon Urbanek
On Dec 15, 2014, at 1:37 PM, Spencer Graves wrote: > > >> On Dec 15, 2014, at 10:13 AM, Simon Urbanek >> wrote: >> >>> >>> On Dec 15, 2014, at 12:21 PM, Kurt Hornik wrote: >>> >>>>>>>> Spencer Graves writes: &g

Re: [Rd] Benchmark code, but avoid printing

2015-01-02 Thread Simon Urbanek
On Jan 2, 2015, at 12:02 PM, Gábor Csárdi wrote: > Dear all, > > I am trying to benchmark code that occasionally prints on the screen > and I want to > suppress the printing. Is there an idiom for this? > > If I do > > sink(tempfile) > microbenchmark(...) > sink() > > then I'll be also measur

Re: [Rd] Help in building R with minGW

2015-01-02 Thread Simon Urbanek
Please read R-admin section 3.1 - as you'll notice it doesn't say anything about running ./configure since that's only for unix. http://r.research.att.com/man/R-admin.html#Building-from-source Cheers, Simon On Jan 2, 2015, at 12:33 PM, Edoardo Baldoni wrote: > Dear R users, > I would need s

Re: [Rd] R CMD build looking for texi2dvi in the wrong place (R-devel)

2015-01-12 Thread Simon Urbanek
Dan, On Jan 12, 2015, at 7:50 PM, Dan Tenenbaum wrote: > R CMD build fails with recent R-devel because it is looking for texi2dvi in > /usr/local/bin, but on this system, MacTex has installed it in /usr/bin. > No, you're looking at the wrong package - texi2dvi comes from texinfo which is now

Re: [Rd] Request to speed up save()

2015-01-15 Thread Simon Urbanek
In addition to the major points that others made: if you care about speed, don't use compression. With today's fast disks it's an order of magnitude slower to use compression: > d=lapply(1:10, function(x) as.integer(rnorm(1e7))) > system.time(saveRDS(d, file="test.rds.gz")) user system elaps

Re: [Rd] Invalid read of size 8

2015-02-05 Thread Simon Urbanek
As you can see from the stack trace the memory you're trying to use has already been released so it was not protected. Since you only provided part of your code we can't really reproduce it or help you. However, why don't you use just use double *MatCovExtra = REAL(PROTECT(allocMatrix(REALSXP,

Re: [Rd] Color Coding in R-devel/NEWS

2015-02-18 Thread Simon Urbanek
On Feb 18, 2015, at 2:44 PM, Bryan Hanson wrote: > > On this feed, which I think is the place we should monitor upcoming changes: > > http://developer.r-project.org/blosxom.cgi/R-devel/NEWS > > What is the significance of the green and pink highlighting? > It highlights the changes since last

Re: [Rd] Reduce memory peak when serializing to raw vectors

2015-03-17 Thread Simon Urbanek
Jorge, what you propose is not possible because the size of the output is unknown, that's why a dynamically growing PStream buffer is used - it cannot be pre-allocated. Cheers, Simon > On Mar 17, 2015, at 1:37 PM, Martinez de Salinas, Jorge > wrote: > > Hi, > > I've been doing some tests

Re: [Rd] Reduce memory peak when serializing to raw vectors

2015-03-17 Thread Simon Urbanek
but more memory efficient, unless I'm > missing something. > > Michael > >> On Tue, Mar 17, 2015 at 2:03 PM, Simon Urbanek >> wrote: >> Jorge, >> >> what you propose is not possible because the size of the output is unknown, >> that's w

Re: [Rd] nested parallel workers

2015-03-25 Thread Simon Urbanek
On Mar 25, 2015, at 3:46 PM, Valerie Obenchain wrote: > Hi Simon, > > I'm having trouble with nested parallel workers, specifically, forking inside > socket connections. > You simply can't by definition - when you fork *all* the workers share the same connection inherited from the parent, so

Re: [Rd] About removing zlib from R-devel

2015-03-26 Thread Simon Urbanek
> On Mar 26, 2015, at 12:09 PM, Gábor Csárdi wrote: > > On Thu, Mar 26, 2015 at 8:49 AM, Prof Brian Ripley > wrote: > [...] >> >> This means that the next version of R will probably not available on Ubuntu >>> >> >> The 'next version of R' will be 3.2.0, and the pre-3.2.0 sources include >>

Re: [Rd] nested parallel workers

2015-03-30 Thread Simon Urbanek
On Mar 30, 2015, at 4:40 PM, Valerie Obenchain wrote: > On 03/25/2015 07:48 PM, Simon Urbanek wrote: >> On Mar 25, 2015, at 3:46 PM, Valerie Obenchain >> wrote: >> >>> Hi Simon, >>> >>> I'm having trouble with nested parallel workers,

Re: [Rd] C-API: check whether R has been initialized ?

2015-05-03 Thread Simon Urbanek
Laurent, On May 3, 2015, at 8:07 PM, Laurent Gautier wrote: > rPython appears to provide an interface from R to Python by embedding > Python and I'd think that it can safely assume that R has been initialized, > but might not be the point here. > > The issue is that a Python package embedding i

Re: [Rd] Alternative for wildcard gnu extension in Makevars

2015-05-15 Thread Simon Urbanek
On May 13, 2015, at 2:28 PM, Henrik Bengtsson wrote: > While at it: 'Makevars' is an R invention (i.e. documentation of it > is only available through the R docs), correct? /Henrik > Well, it's just a Makefile fragment that gets included along with the rest of the Makefiles, so for all pract

Re: [Rd] Question about Rweb

2011-10-05 Thread Simon Urbanek
On Oct 5, 2011, at 2:16 PM, Tonidandel, Scott wrote: > Greetings, > > I am working on creating an interactive website that will generate R-code for > users based in the information they input on the site. Currently, the R-code > can be generated and downloaded to be run locally on a computer w

Re: [Rd] Question about Rweb

2011-10-05 Thread Simon Urbanek
client from Rserve instead of CGI. If you really want to use Windows, I have fixed the Windows build so it should work, but you'll have to configure it by hand -- but as I said, I strongly discourage the use of Windows for any R-related server activities - there are too many security implication

Re: [Rd] Question about Rweb

2011-10-05 Thread Simon Urbanek
Ted, On Oct 5, 2011, at 6:06 PM, Ted Byers wrote: > Hi Simon, > >> -Original Message----- >> From: Simon Urbanek [mailto:simon.urba...@r-project.org] >> Sent: October-05-11 5:07 PM >> To: Ted Byers >> Cc: 'Tonidandel, Scott'; r-devel@r-projec

Re: [Rd] Question about Rweb

2011-10-06 Thread Simon Urbanek
On Oct 6, 2011, at 12:20 PM, Dirk Eddelbuettel wrote: > > On 6 October 2011 at 09:37, Jay Emerson wrote: > | Ted, > | > | Simon may be biased, but I am not. I'm barely a few days into > | Rserve/FastRWeb and am blown away (and frustrated that I didn't have a > | good excuse to give it a try so

Re: [Rd] R CMD INSTALL writes to stderr

2011-10-10 Thread Simon Urbanek
On Oct 10, 2011, at 8:48 PM, Mark Cowley wrote: > Dear list, > (this is a follow up from a previous query) > > Why does R CMD INSTALL write most of its messages to stderr? If it wrote to > stdout, then we could capture its output within an R session when calling > sink("stdout.txt", type="outp

Re: [Rd] how to make a true binary package?

2011-10-11 Thread Simon Urbanek
On Oct 11, 2011, at 1:09 PM, A Zege wrote: > OK, gentlemen, i agree with you in general. I was not talking about a general > purpose, general use package that one prepares for CRAN. I am sure you are > familiar professionally or can imagine situations where you need to > demonstrate a solution to

Re: [Rd] how to return a matrix of strings from c to R ?

2011-10-14 Thread Simon Urbanek
On Oct 13, 2011, at 3:20 AM, Alok Jadhav wrote: > I am a bit confused about usage of R internal functions. I am able to send a > char vector from C to R but not sure on how to send a vector of strings etc. > > My code looks like this. > > > >SEXP result = > PROTECT(Rf_allocMat

Re: [Rd] gctorture() and gzfile() doesn't get along.

2011-10-15 Thread Simon Urbanek
Thanks, now fixed. It affected almost all connections. Simon On Oct 15, 2011, at 2:32 PM, Hin-Tak Leung wrote: > Found the simpliest way of seeing I bug I encountered doing "R CMD check > --use-gct": Just launch R (with --vanilla), and do this: > >> ?gctorture > # this work >> gctorture() >> ?

Re: [Rd] readRDS and saveRDS

2011-10-19 Thread Simon Urbanek
On Oct 18, 2011, at 8:32 PM, Hervé Pagès wrote: > On 11-10-18 04:00 PM, Kevin Wright wrote: >> Hadley, >> >> Any chance of changing fun.aggregate to FUN and value_var to value.var? >> >> aggregate(.., FUN, ...) >> acast(..., fun.aggregate, ...) >> >> cast(..., value.var) >> acast(..., value_va

Re: [Rd] R fails when converting units using Hershey-Fonts

2011-10-25 Thread Simon Urbanek
Thanks, now fixed. Simon On Oct 25, 2011, at 5:21 AM, Mark Heckmann wrote: > I run into some problems when trying to convert units using Hershey-Fonts: R > chrashes. > >> library(grid) >> label <- "some text" >> pushViewport(viewport(gp=gpar(fontfamily="HersheySerif"))) >> convertHeight(string

Re: [Rd] Error message library()

2011-10-26 Thread Simon Urbanek
On Oct 26, 2011, at 6:49 AM, Milan Bouchet-Valat wrote: > Le mercredi 26 octobre 2011 à 09:46 +, ONKELINX, Thierry a écrit : >> Dear all, >> >> When one tries to load a non-installed package you get the error: >> >> Error in library(xyz) : there is no package called 'xyz' >> >> I noticed

Re: [Rd] Error message library()

2011-10-26 Thread Simon Urbanek
On Oct 26, 2011, at 1:05 PM, Milan Bouchet-Valat wrote: > Le mercredi 26 octobre 2011 à 12:34 -0400, Simon Urbanek a écrit : >> Please, no! We don't want to enter the realm of the computer assuming >> it knows what you want to do (which is becoming too common nowadays, >

Re: [Rd] Error message library()

2011-10-26 Thread Simon Urbanek
On Oct 26, 2011, at 4:06 PM, Hadley Wickham wrote: >> Please, no! We don't want to enter the realm of the computer assuming it >> knows what you want to do (which is becoming too common nowadays, >> unfortunately, making the interaction more and more annoying). For some >> users this error sim

Re: [Rd] Error message library()

2011-10-28 Thread Simon Urbanek
On Oct 28, 2011, at 6:49 AM, Renaud Gaujoux wrote: > "BTW: an ever more intuitive solution (IMHO) would be to auto-complete > package names in library( ... Deepayan?;) That is non-intrusive and in line > with the general use of R." (Simon) > > This is indeed a long wanted feature and to my su

Re: [Rd] Sweave, cairo_pdf, xetex, CJK (Re: Sweave, cairo_pdf, CJK, ghostscript)

2011-10-31 Thread Simon Urbanek
On Oct 31, 2011, at 5:56 PM, Hin-Tak Leung wrote: > I am still doing some cosmetic things (adding annotations with some of the > really minority languages in Sichuan), but here are a few misc tips and > quirks so far: > > - cairo_pdf() behaves differently via "R CMD Sweave " vs Sweave("file")

Re: [Rd] Sweave, cairo_pdf, xetex, CJK (Re: Sweave, cairo_pdf, CJK, ghostscript)

2011-10-31 Thread Simon Urbanek
On Oct 31, 2011, at 7:52 PM, Hin-Tak Leung wrote: > --- On Mon, 31/10/11, Simon Urbanek wrote: > >> On Oct 31, 2011, at 5:56 PM, Hin-Tak Leung wrote: >> >>> I am still doing some cosmetic things (adding >> annotations with some of the really minority languag

Re: [Rd] reducing a too-large matrix obtained with allocMatrix()

2011-11-01 Thread Simon Urbanek
On Nov 1, 2011, at 4:29 PM, Steven Dirkse wrote: > Hello, > > I have some C code (for a shared lib called via .External) that uses > > PROTECT(w= allocMatrix(REALSXP, m, n)); > > mostly successfully. In rare cases, though, the row count m will be > an overestimate. Is there a way to realloc

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

2011-11-01 Thread Simon Urbanek
On Nov 1, 2011, at 9:08 PM, andre zege wrote: > Hi, guys. I posted this by accident at rcpp-dev, although it meant to > be only to r-dev, so don't flame me here please, rcpp guys will > do it there, i am sure :). > I have some pretty large arrays in R and i wanted to do some time > consuming modi

Re: [Rd] Static R Build

2011-11-04 Thread Simon Urbanek
On Nov 4, 2011, at 4:37 PM, Michael Yan wrote: > Hello, > > I am trying to build a statically linked R linux binary that can be shipped > around to different unknown linux environments without having to rely on its > local shared libraries. However, it seems like the configure flag > > --ena

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

2011-11-08 Thread Simon Urbanek
On Nov 8, 2011, at 2:42 PM, KR wrote: > Hi all, > > I am facing the necessity to parse R code from C-side. As a first > approximation > the goal would be a re-implementation of the R shell (not Rgui). > > I read the document at http://cran.r-project.org/doc/manuals/R-exts.html > section > 5

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
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 have some issues to solve > in > order to complete the interface to R I am working on: > > 1. I ini

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
Tyler, On Nov 11, 2011, at 7:55 PM, Tyler Pirtle wrote: > Hi, > > I've got a C extension structured roughly like: > > package/ > src/ >Makevars >foo.c >some-lib/... >some-other-lib/.. > > where foo.c and Makevars define dependencies on some-lib and > some-other-lib. Currently

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
Jordi, I think you are misunderstanding a few things here. First, "R" doesn't endorse anything - it is a program, it does what you tell it to do. Second, whoever runs R-forge doesn't endorse the packages hosted on it, either. It's just an infrastructure, with no claim about endorsement of the p

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

2011-11-21 Thread Simon Urbanek
John, On Nov 21, 2011, at 8:17 AM, John C Nash wrote: > I think the poster is interested in being able to try the build/check on a > Mac in the > fashion that Winbuilder does. That is, rather than have CRAN do all the > platform checks, > is there a way to submit a package to be tested for just

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

2011-11-23 Thread Simon Urbanek
On Nov 23, 2011, at 6:48 PM, Hadley Wickham wrote: > Hi all, > > I'd like to discuss a infelicity/possible bug with gsub. Take the > following function: > > f <- function(x) { > gsub("\u{A0}", " ", gsub(" ", "\u{A0}", x)) > } > > As you might expect, in utf-8 locales it is idempotent: > > S

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:36 PM, Henri

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

2011-11-24 Thread Simon Urbanek
print(e)) > f() Cheers, Simon > Cheers, > > Henrik > > On Wed, Nov 23, 2011 at 6:56 PM, Simon Urbanek > wrote: >> IMHO this has nothing to do with capture.output() per se - it's simply lazy >> evaluation that gets you. Add force(envir) before capture

Re: [Rd] Confused about NAMED

2011-11-24 Thread Simon Urbanek
On Nov 24, 2011, at 8:05 AM, Matthew Dowle wrote: >> >> On Nov 24, 2011, at 12:34 , Matthew Dowle wrote: >> On Nov 24, 2011, at 11:13 , Matthew Dowle wrote: > Hi, > > I expected NAMED to be 1 in all these three cases. It is for one of > them, > but not the

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
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 than the other ones, so it doesn't have paste0 while the others do. The really strange thing is that the build logs show success, but the build directory is old

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

2011-12-18 Thread Simon Urbanek
Barry, that's a great idea. I have created a package that allows you to read/write passwords to user's keychain: http://www.rforge.net/keychain So far it uses the Security framework so you'll need a Mac, it but I'm about to add a generic fall-back system (encrypted file on-disk) and possibly t

Re: [Rd] Saving nothing with save()

2011-12-19 Thread Simon Urbanek
Martin, On Dec 19, 2011, at 6:39 AM, Martin Maechler wrote: >> Barry Rowlingson >>on Sun, 18 Dec 2011 01:32:52 + writes: > >> Scenario: Here I am working away in R. I've got results >> that prove global warming is anthropogenic and also the >> solution for producing limitless ca

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

2011-12-19 Thread Simon Urbanek
On Dec 19, 2011, at 10:30 AM, Jonathan Shore wrote: > I've written a rather complex package that requires overriding the default > compilation behavior for the C code component. In the src dir I have a > Makefile that is used correctly on OSX and Linux builds of the package, but > completely

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
Patrick, On Dec 28, 2011, at 12:07 AM, Patrick Leyshock wrote: > I have an external pointer object that I'd like to pass from my R code to > some C code. Per Section 5.13 of "Writing R Extensions", I've noted that > "external pointers should only be used as part of an object with normal > semant

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
Paul, On Jan 3, 2012, at 3:08 PM, Paul Johnson wrote: > I would like to ask for advice from R experts about the benefits or > dangers of using attr to return information with an object that is > returned from a function. I have a feeling as though I have cheated by > using attributes, and wonder

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
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 to using > .Call on the original object can > cause the C code to alter not only the object passed to it but also > the copy in R. Please see the docs - .Call does *NOT* h

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
On Jan 17, 2012, at 4:50 PM, Thomas Lumley wrote: > On Tue, Jan 17, 2012 at 9:11 PM, Matthew Dowle wrote: >> Hi, >> >> $ R --vanilla >> R version 2.14.1 (2011-12-22) >> Platform: i686-pc-linux-gnu (32-bit) >>> DF = data.frame(a=1:3,b=4:6) >>> DF >> a b >> 1 1 4 >> 2 2 5 >> 3 3 6 >>> tracemem(D

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

2012-01-18 Thread Simon Urbanek
On Jan 18, 2012, at 5:22 PM, Steven McKinney wrote: > > Hi all, > > I have been having problems generating png files on a Mac running OS X > 10.6.8. > > Here's a simple example > >> png("foo.png", type = "cairo"); plot(1:10); dev.off(); > null device > 1 > libpng warning: Applica

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