Re: [Rd] How x[, 'colname1'] is implemented?

2010-01-01 Thread Barry Rowlingson
On Thu, Dec 31, 2009 at 11:27 PM, Peng Yu pengyu...@gmail.com wrote: I don't see where describes the implementation of '[]'. For example, if x is a matrix or a data.frame, how the lookup of 'colname1' is x[, 'colname1'] executed. Does R perform a lookup in the a hash of the colnames? Is the

[Rd] bug report field in DESCRIPTION file?

2009-11-26 Thread Barry Rowlingson
A lot of R packages are now effectively maintained by several people and so use sites like R-forge or google code for development. This means the best way to report bugs or problems with these packages is via the development site's bug tracking rather than emailing the maintainer. Could we agree

Re: [Rd] bug report field in DESCRIPTION file?

2009-11-26 Thread Barry Rowlingson
On Thu, Nov 26, 2009 at 1:39 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: This sounds like a good idea, though I would add a package parameter to the bug.report() function, rather than creating a new function. I'm sure when I did help.search(bug) and help.search(report) this morning I didn't

Re: [Rd] OOP with Encapsulated Class Definitions

2009-11-23 Thread Barry Rowlingson
On Mon, Nov 23, 2009 at 10:04 AM, Charlotte Maia mai...@gmail.com wrote: Hi all, I'm seeking feedback (good, bad or indifferent) in regards to developing (further) a new class system for R, that uses encapsulated class definitions (i.e. the method definitions are literally inside the body of

Re: [Rd] Viewing pdfs from inst/doc

2009-09-04 Thread Barry Rowlingson
On Fri, Sep 4, 2009 at 10:44 PM, rudjerrkoen...@uiuc.edu wrote: Writing R extensions says: In addition to the help files in Rd format, R packages allow the inclusion of documents in arbitrary other formats. The standard location for these is subdirectory inst/doc of a source package, the

Re: [Rd] License of Port3 library for R

2009-09-02 Thread Barry Rowlingson
On Wed, Sep 2, 2009 at 2:49 AM, Pin Tian Ngpin...@nau.edu wrote:      I developed some code that called subroutines from the Port3 Library (http://www-out.bell-labs.com/project/PORT/).  I¹m thinking about making it available as an R package.  But I¹m not sure if their NON-EXCLUSIVE SOURCE CODE

[Rd] Lightweight 'package' idea.

2009-08-21 Thread Barry Rowlingson
I'm often wanting to develop functions whilst manipulating data. But I don't want to end up with a .RData full of functions and data. It might be that I have functions that are re-usable but not worth sticking in a package. So I've tried to come up with a paradigm for function development that

Re: [Rd] Roxygenating packages

2009-07-08 Thread Barry Rowlingson
On Wed, Jul 8, 2009 at 3:53 PM, hadley wickhamh.wick...@gmail.com wrote: Sounds like a neat idea!  Especially with Duncan Murdoch's recent work making it easy to parse rdoc files in R. I reckon the tricky bit is going to be working out how to map the various possibilities of rdoc files into

Re: [Rd] Matrix with random number

2009-06-30 Thread Barry Rowlingson
    x(i,j) = call myrbeta(1,4,5) ! It's correct? The code of the error in R is: dyn.load(func.so) Error in dyn.load(func.so) :   unable to load shared library '/home/julio/Orientados/Fabio/Fortran/mat-fortran/func.so':   /home/julio/Orientados/Fabio/Fortran/mat-fortran/func.so:

[Rd] Show location of workspace image on quit?

2009-06-05 Thread Barry Rowlingson
When I quit R, it says: q() Save workspace image? [y/n/c]: and since I've probably got 3 R sessions running in however many different directories and I might have jumped around with setwd() , I forget exactly where R wants to save its workspace image. So could q() be changed to say what file

Re: [Rd] Show location of workspace image on quit?

2009-06-05 Thread Barry Rowlingson
On Fri, Jun 5, 2009 at 1:46 PM, Mathieu Ribatetmathieu.riba...@epfl.ch wrote: I guess that having something like this q() Save workspace image (/home/me/workspace/.RData)? [y/n/c/e]: where e means Editing the path should be clear enought, isn't it? 'e' might be thought to mean 'exit' in

Re: [Rd] Show location of workspace image on quit?

2009-06-05 Thread Barry Rowlingson
On Fri, Jun 5, 2009 at 3:01 PM, Gabor Grothendieckggrothendi...@gmail.com wrote: Save workspace to /home/me/workspace/.RData? [ y(es) / (n(o) / c(ancel) / o(ther) ]: Quitting emacs produces this: Save file /foo/bar/baz.qux? (y, n, !, ., q, C-r, d or C-h) I'm not sure what any other than

Re: [Rd] setdiff bizarre (was: odd behavior out of setdiff)

2009-06-02 Thread Barry Rowlingson
On Tue, Jun 2, 2009 at 4:13 PM, Stavros Macrakis macra...@alum.mit.edu wrote: but simply treats the data frame as a *character* list:     1 %in% data.frame(a=2,b=1)  # TRUE     '1' %in% data.frame(a=2,b=1)  # TRUE     1 %in% data.frame(a=2:3,b=1:2) # FALSE     1:3 %in%

Re: [Rd] plot ignores type= n when x is factor (PR#13703)

2009-05-26 Thread Barry Rowlingson
On Tue, May 26, 2009 at 5:58 PM, Paul Johnson pauljoh...@gmail.com wrote: There's no mention of plot.factor in the plot help page. Yes there is, but hidden slightly more than the planning application for the destruction of the Earth (It was on display in the bottom of a locked filing cabinet

[Rd] Scope problem?

2009-05-22 Thread Barry Rowlingson
I've just spent today trying to fix a Heisenbug... this function returns a linear interpolator function: interpOne - function(xl,yl){ f = function(data){ t = (data-min(xl))/(max(xl)-min(xl)) return(min(yl)+t*(max(yl)-min(yl))) } return(f) } k=interpOne(c(0,1),c(4,5)) k(0.5) [1]

Re: [Rd] Colour Schemes

2009-05-21 Thread Barry Rowlingson
On Thu, May 21, 2009 at 2:18 PM, richard.cot...@hsl.gov.uk wrote: Most of the plots where colour is typically used to signify a variable already do map colours to data values.  Take a look at help pages for levelplot/contourplot/wireframe from the lattice package, and image from base

[Rd] R in a sandbox/jail

2008-12-07 Thread Barry Rowlingson
Someone recently suggested building a system for automatically testing student's R programs. They would upload them to our Virtual Learning Environment, which would then run the code on some inputs and see if it got the right output. If it does, the student scores points for that course. My first

Re: [Rd] writting null (\000 or ^@) to an external text file without the new warning

2008-10-28 Thread Barry Rowlingson
2008/10/28 Greg Snow [EMAIL PROTECTED]: I have some functions that write an external text file for postprocessing by another program. Some instructions to the other program need to be indicated by null values (\000 or ^@). The function currently uses code like:

Re: [Rd] Possible GPL Violation

2008-10-22 Thread Barry Rowlingson
It seems unlikely that the functionality of this program can be separated from the R-packages upon which it relies, thus making them one work subject to GPL. Does anyone have any experience with this software/company? Any thoughts? They're not distributing R itself: You must have R on your

Re: [Rd] Possible GPL Violation

2008-10-22 Thread Barry Rowlingson
2008/10/22 Ian Fellows [EMAIL PROTECTED]: Perhaps my understanding of GPL is lacking, but isn't this the reason that GPL is different for LGPL? Linking to functions is allowed in the lesser license, but not in GPL. From the gpl faq:

Re: [Rd] indexing by character with identical names

2008-09-19 Thread Barry Rowlingson
2008/9/19 Jake Michaelson [EMAIL PROTECTED] ... that is, if a vector has identical (and therefore ambiguous) names, it only returns the first match when the vector is indexed by a non-unique name. From my perspective, a more sensible behavior would be to return *all* elements which carry the

Re: [Rd] ** operator

2008-05-15 Thread Barry Rowlingson
Duncan Murdoch wrote: It's fairly unlikely to go away, but it's an old undocumented feature, so use at your own risk. There are lots of other undocumented features, but maybe no others at the lexical level. Check out src/main/gram.y if you want to search for more at that level, and src/* if

Re: [Rd] X11cairo with antialias=none buggy under MacOS?

2008-05-01 Thread Barry Rowlingson
Joerg van den Hoff wrote: X11(antialias=none) I obviously am going to plot to the screen device. where a line width below one pixel does'nt make sense to me. what am I missing? The new cairo X11 device with antialiasing off can indeed look awful , but if you really don't want

[Rd] R CMD check leaving object files.

2008-04-07 Thread Barry Rowlingson
If I run R CMD check on my package source directory I get no warnings (okay, at the moment I get a few, but lets imagine for the sake of argument I don't). Then if I run it again I get a warning about my source package having object files in it: * checking if this is a source package ...

Re: [Rd] 0.450.45 = TRUE (PR#10744)

2008-02-13 Thread Barry Rowlingson
hadley wickham wrote: It's more than that as though, as floating point addition is no longer guaranteed to be commutative or associative, and multiplication does not distribute over addition. Many concepts that are clear cut in pure math become fuzzy in floating point math - equality,

[Rd] Rapid Random Access

2007-12-14 Thread Barry Rowlingson
I have some code that can potentially produce a huge number of large-ish R data frames, each of a different number of rows. All the data frames together will be way too big to keep in R's memory, but we'll assume a single one is manageable. It's just when there's a million of them that the

Re: [Rd] Rapid Random Access

2007-12-14 Thread Barry Rowlingson
Tony Plate wrote: This is exactly the type of situation that the trackObjs package is designed for. Ooh, I'm having deja-vu - yes I think I saw this package a while back and wondered what magic it did. I shall go play with it later. Thanks Barry

[Rd] Building packages

2007-12-07 Thread Barry Rowlingson
I've started a new package and I'm trying to work out the best way to do it. I'm managing my package source directory with SVN, but R CMD build likes to dump things in the inst/doc directory when making vignette PDF files. I don't want to keep these in SVN (they aren't strictly 'source'), so

Re: [Rd] Building packages

2007-12-07 Thread Barry Rowlingson
Oleg Sklyar wrote: If I am not mistaken R CMD build builds the package temporarily and uses that build to build the vignette, so where is the problem? All my vignettes build fine on both Linux and Windows and on Windows you actually see that running R CMD build --binary builds the source code

Re: [Rd] Returning vectors of two different data types back to R environment (from C).

2007-11-16 Thread Barry Rowlingson
Charles Danko wrote: Hello, Quick question. I have written a C function - I would like to make it return two vectors to the R environment - one STRSXP vector, and one INTSXP vector. Is this possible/ easy to do using the API? I looked, but could not find the answer to this question

Re: [Rd] the amazing prof. ripley ...

2007-08-03 Thread Barry Rowlingson
Ben Bolker wrote: x = readLines(http://developer.r-project.org/R.svnlog.2007;) rx = x[grep(^r,x)] who = gsub( ,,sapply(strsplit(rx,\\|),[,2)) twho = table(who) twho[ripley]/sum(twho) 74% of all commits! And 99% of all 'This is not a bug/You have not read the posting guide' messages!

Re: [Rd] Compiling R for the Sony Playstation 3?

2007-08-03 Thread Barry Rowlingson
[EMAIL PROTECTED] wrote: Beyond that, there may be a few more things that can be done to make R run stupidly fast on ps3 or IBM Cell blades. Wouldn't the right way to go here be to make it use the PS3 graphics hardware, in a http://www.gpgpu.org/ kind of way? Or are the Cell processors

[Rd] Saving R graphics as various file types.

2007-07-18 Thread Barry Rowlingson
I'm using R called via Rpy from Python running from Quantum GIS. Put simply, I'm developing a GUI wrapper round some R plotting functions. What I want to do is offer the user a 'Save Plot As...' option. The problem is divining what sort of output files R can copy a graphics device into.

[Rd] attach/detach asymmetry

2007-05-16 Thread Barry Rowlingson
Is there a good reason why arguments to 'attach' and 'detach' differ so much? Yes, I know this is the documented behaviour, it just seems to violate the principle of least surprise. Examples: file = foo.RData df = data.frame(x=1:10,y=1:10) attach(file) # attaches the RData file

Re: [Rd] R-Forge?

2007-04-12 Thread Barry Rowlingson
Gregor Gorjanc wrote: I have recently found RForge.net (http://www.rforge.net/) by Simon Urbanek and found out today that the site is accepting subscriptions. Great! However, browsing a bit on the site I found a link to another forge: R-Forge (http://r-forge.r-project.org/). Is/will the

Re: [Rd] Bridging R to OpenOffice

2007-03-29 Thread Barry Rowlingson
Kevin B. Hendricks wrote: As I remember, I think someone has built an interface from Gnumeric to R if I am not mistaken. That project if it is still alive might provide a nice model of how to interface from a spreadsheet to R without lots of GUI front end stuff being needed. As I

Re: [Rd] can't plot a line

2007-01-23 Thread Barry Rowlingson
Spencer Graves wrote: Consider the following: plot(0, 0, xlim=c(-10, 10), ylim=c(-50, 50)) lines(c(0,0), (2*c(-pi, pi))^2) Because squaring is done before multiplication - its higher priority. Hence you end up with (-2*pi)^2 and (2*pi)^2, which are the same, and your 'line'

[Rd] obsolescence

2007-01-19 Thread Barry Rowlingson
Since many posts to R-devel/help invoke this response: Prof Brian Ripley wrote: Please, use the current version of R and not an obselete one is there an argument for including a version check on R startup? These things seem somewhat in vogue these days (what with everything on the internet

Re: [Rd] Which programming paradigm is the most used for make R packages?

2007-01-04 Thread Barry Rowlingson
Ross Boylan wrote: On Wed, Jan 03, 2007 at 11:46:16AM -0600, Ricardo Rios wrote: Hi wizards, does somebody know Which programming paradigm is the most used for make R packages ? Thanks in advance. You need to explain what you mean by the question, for example what paradigms you have in

[Rd] Detecting compilation under R

2006-12-14 Thread Barry Rowlingson
The docs tell me: The header files define USING_R, which should be used to test if the code is indeed being used with R. but surely you only get that if you #include R.h, which you can only do if you are using R. If you have code that you might want to compile in R and for other purposes, how

Re: [Rd] Detecting compilation under R

2006-12-14 Thread Barry Rowlingson
Prof Brian Ripley wrote: If *no* R.h is around: easy to solve. Have a dummy R.h somewhere? What is BUILD? Oh, pardon me for forgetting the arbitrary capitalisation of R CMD thingies. Can someone come up with a mnemonic for remembering that BATCH, COMPILE, SHLIB, INSTALL, LINK and

Re: [Rd] Detecting compilation under R

2006-12-14 Thread Barry Rowlingson
So the problem is that you needed rather #include R.h #ifdef USING_R x = rand_unif(0.0,1.0); #else #include gsl_random.h x = gsl_runif(0.0,1.0); #endif since if R.h is not around, the include will not include it. If R.h is not around, the preprocessor will throw a tantrum: cc

Re: [Rd] c.factor

2006-11-15 Thread Barry Rowlingson
It does not remove names in Splus either, just all other attributes. I see c() used in several Splus functions as a way to convert a matrix into a vector (by removing the .Dims and .Dimnames attributes). I dont see the logic in certain attribute names (?attr lists 'class', 'comment',

Re: [Rd] R-Project logo in SVG format

2006-08-31 Thread Barry Rowlingson
[EMAIL PROTECTED] wrote: After you created one and submitted it to us probably at the same place as the bitmaps. In the meantime it will have to suffice that you use all we have, and that are the bitmaps (the logo was done by a volunteer who chose to use a bitmapped graphics program). It is

Re: [Rd] Using TCP/IP sockets in R

2006-08-16 Thread Barry Rowlingson
Dirk Eddelbuettel wrote: Are you aware of Simon's Rserve project at http://www.rosuda.org/Rserve/ ? It already has Java and C++ client code -- it would be nice if you could add Python client code to this project. I dont think its feature-complete or well-tested or documented and certainly

Re: [Rd] Error - Compiling R on a Sun V40Z - R/R-2.2.1

2006-06-23 Thread Barry Rowlingson
[EMAIL PROTECTED] wrote: The current version of R is 2.3.1 patched. You are asked not to report problems on obselete versions of R. This seems to be gcc 3.3.6, also obselete. If configure says: configure: WARNING: ## --- ## configure: WARNING: ##

Re: [Rd] Accuracy of dnorm (PR#8586)

2006-02-10 Thread Barry Rowlingson
Prof Brian Ripley wrote: The dnorm functions yield a wrong value when the standard deviation is near to 1e-1 What is wrong here? Try the textbook formula x - 0 m - 0.04 sd - 0.3 1/(sqrt(2*pi)*sd) * exp(-0.5*(x-m)^2/sd^2) [1] 1.318039 Even MS Excel gets this one right:

[Rd] R on Thin Client with Win 2003

2006-01-04 Thread Barry Rowlingson
I'm having some fun with R on a Windows 2003 Server talking to a Wyse Winterm running Thinstation Linux. The Winterm boots Linux from the network and then runs rdesktop to a Dell 1750 server (dual 3G Xeon or somesuch). The first problem I noticed was that R (and the terminal) ground to a near

Re: [Rd] two-way communication using Unix pipes

2005-11-16 Thread Barry Rowlingson
Jonathan Callahan wrote: Can someone please explain to me exactly what R is doing with the the standard IO handles and whether or not there is any simple way to convince it to behave as if it were talking to a user at the other end of a keyboard and terminal? I've already tried

[Rd] image() with all NAs fails (PR#8228)

2005-10-20 Thread barry . rowlingson
Full_Name: Barry Rowlingson Version: 2.2.0 OS: Linux Submission from: (NULL) (194.80.32.8) The image function with a matrix of all NA values fails with: xyz=list(x=1:3,y=1:4,z=matrix(NA,3,4)) image(xyz) Error in image.default(xyz) : invalid z limits In addition: Warning messages: 1: no finite

Re: [Rd] R crashes for large formulas in lm() (PR#8180)

2005-10-05 Thread Barry Rowlingson
Prof Brian Ripley wrote: OK, let's try to reproduce that: x1 - runif(1000) ... y - rnorm(1000) fit - lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) No crash, a quite reasonable fit. Add one more: x9 - runif(1000) works with 8: fit - lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) but go 'one over

Re: [Rd] R crashes for large formulas in lm() (PR#8180)

2005-10-05 Thread Barry Rowlingson
set.seed(123) x1 - runif(1000) x2 - runif(1000) x3 - runif(1000) x4 - runif(1000) x5 - runif(1000) x6 - runif(1000) x7 - runif(1000) x8 - runif(1000) y - rnorm(1000) fit - lm(y~(x1*x2*x3*x4*x5*x6*x7*x8)^2) For me (with 9 variables) this crashes in model.matrix:

Re: [Rd] as.Date() , feature or bug?

2005-09-15 Thread Barry Rowlingson
Prof Brian Ripley wrote: What does anyone want such dates for? I hope there was an extremely good reason to spend other people's time on this, and look forward to an extremely convincing explanation. I can think of one case where I've seen exact dates that far in the future used:

Re: [Rd] Compiling R scripts

2005-07-04 Thread Barry Rowlingson
Uzuner, Tolga wrote: Dear R Developers, It would help if R scripts could be compiled into an executable, or a library. Are you sure it would help? If you do a big matrix operation in R it runs at the speed of the underlying C code. It wont get much faster. Profile your code, find out

<    1   2