Re: [Rd] Using .onUnload to unload DLLs

2012-07-23 Thread Prof Brian Ripley
On 24/07/2012 07:11, Winston Chang wrote: I've noticed that many of the "base" R packages have an .onUnload() function which automatically unloads compiled shared libraries with library.dynam.unload(). For example: stats:::.onUnload function (libpath) library.dynam.unload("stats", libpath)

[Rd] Using .onUnload to unload DLLs

2012-07-23 Thread Winston Chang
I've noticed that many of the "base" R packages have an .onUnload() function which automatically unloads compiled shared libraries with library.dynam.unload(). For example: > stats:::.onUnload function (libpath) library.dynam.unload("stats", libpath) I've noticed that many other packages don't

Re: [Rd] S4 objects in formulas (really, model frames)

2012-07-23 Thread Prof Brian Ripley
The help for model.frame says Only variables whose type is raw, logical, integer, real, complex or character can be included in a model frame: this includes classed variables such as factors (whose underlying type is integer), but excludes lists. Some S4 objects are of one of

Re: [Rd] Finding dynamic shared libraries loaded with a package

2012-07-23 Thread Winston Chang
On Mon, Jul 23, 2012 at 7:47 PM, Gabor Grothendieck wrote: > On Mon, Jul 23, 2012 at 8:29 PM, Winston Chang > wrote: > > Is there a way to query a package to see what dynamic shared libraries > are > > loaded with it? > > > > This gives a "DLLInfoList" class object whose components are info > as

Re: [Rd] Finding dynamic shared libraries loaded with a package

2012-07-23 Thread Gabor Grothendieck
On Mon, Jul 23, 2012 at 8:29 PM, Winston Chang wrote: > Is there a way to query a package to see what dynamic shared libraries are > loaded with it? > This gives a "DLLInfoList" class object whose components are info associated with the loaded dll's DLLInfoList <- library.dynam() and this gives

[Rd] Finding dynamic shared libraries loaded with a package

2012-07-23 Thread Winston Chang
Is there a way to query a package to see what dynamic shared libraries are loaded with it? The reason I ask is because during development, I want to unload libraries so that they can be reloaded without restarting R. I want to make it automatic so that you can just pass in the name of the package

Re: [Rd] On RObjectTables

2012-07-23 Thread Michael Lawrence
Luke, Please keep me advised on this, because the Qt interfaces heavily rely on the ObjectTables (btw, it has worked great for my use cases). Michael On Fri, Jul 20, 2012 at 7:32 AM, wrote: > I believe everyone who has worked on the relevant files has tried to > maintain this functionality, bu

[Rd] S4 objects in formulas

2012-07-23 Thread David L Lorenz
Hi, I have very carefully developed several S4 classes that describe censored water-quality data. I have routines for them that will support their use in data.frames and so forth. I have run into a problem when I try to use the S4 class as the response variable in a formula and try to extract

Re: [Rd] large dataset - confused

2012-07-23 Thread oliver
On Mon, Jul 23, 2012 at 10:32:42AM -0700, walcotteric wrote: > I'm trying to load a dataset into R, but I'm completely lost. This is > probably due mostly to the fact that I'm a complete R newb, but it's got me > stuck in a research project. [...] Hmhh, becoming stuck in a "research project", be

Re: [Rd] Reading many large files causes R to crash - Possible Bug in R 2.15.1 64-bit Ubuntu

2012-07-23 Thread Simon Urbanek
On Jul 23, 2012, at 12:49 PM, David Terk wrote: > Thank you for getting this done so quickly. This will process now. > > One quick question regarding a call to as.character.POSIXt. When using > scan, since scan reads line by line, would it make sense to have the ability > to perform a char ->

Re: [Rd] large dataset - confused

2012-07-23 Thread oliver
On Mon, Jul 23, 2012 at 06:42:17PM +0100, Prof Brian Ripley wrote: [...] > BTW, 'large dataset' is meaningless: when I asked a class of > Statistics PhD students the answers differed by 7 orders of > magnitude. [...] lol But isn't 7 a "small" number? ;-) Ciao, Oliver

Re: [Rd] Reading many large files causes R to crash - Possible Bug in R 2.15.1 64-bit Ubuntu

2012-07-23 Thread Brian G. Peterson
On 07/23/2012 11:49 AM, David Terk wrote: One quick question regarding a call to as.character.POSIXt. When using scan, since scan reads line by line, would it make sense to have the ability to perform a char -> POSIXct conversion on each line that is read, rather than after all lines have been r

Re: [Rd] large dataset - confused

2012-07-23 Thread Sarah Goslee
Hi, On Mon, Jul 23, 2012 at 1:32 PM, walcotteric wrote: > I'm trying to load a dataset into R, but I'm completely lost. This is > probably due mostly to the fact that I'm a complete R newb, but it's got me > stuck in a research project. > I've tried just opening the text file in WordPad and copy

Re: [Rd] large dataset - confused

2012-07-23 Thread R. Michael Weylandt
1) Move this off R-devel to R-help. 2) Read the IO manual here: http://cran.r-project.org/manuals.html 3) You probably want to look at the read.table() function's help page by typing ?read.table Michael On Mon, Jul 23, 2012 at 12:32 PM, walcotteric wrote: > I'm trying to load a dataset into R,

Re: [Rd] large dataset - confused

2012-07-23 Thread Brian G. Peterson
On 07/23/2012 12:32 PM, walcotteric wrote: I'm trying to load a dataset into R, but I'm completely lost. This is probably due mostly to the fact that I'm a complete R newb, but it's got me stuck in a research project. I've tried just opening the text file in WordPad and copying the data directly

Re: [Rd] large dataset - confused

2012-07-23 Thread Prof Brian Ripley
On 23/07/2012 18:32, walcotteric wrote: I'm trying to load a dataset into R, but I'm completely lost. This is probably due mostly to the fact that I'm a complete R newb, but it's got me stuck in a research project. I've tried just opening the text file in WordPad and copying the data directly in

[Rd] large dataset - confused

2012-07-23 Thread walcotteric
I'm trying to load a dataset into R, but I'm completely lost. This is probably due mostly to the fact that I'm a complete R newb, but it's got me stuck in a research project. I've tried just opening the text file in WordPad and copying the data directly into R, but it's too big and causes the pro

Re: [Rd] Reading many large files causes R to crash - Possible Bug in R 2.15.1 64-bit Ubuntu

2012-07-23 Thread David Terk
Thank you for getting this done so quickly. This will process now. One quick question regarding a call to as.character.POSIXt. When using scan, since scan reads line by line, would it make sense to have the ability to perform a char -> POSIXct conversion on each line that is read, rather than af

Re: [Rd] Reading many large files causes R to crash - Possible Bug in R 2.15.1 64-bit Ubuntu

2012-07-23 Thread Joshua Ulrich
David, Thank you for providing something reproducible. This line: templateTimes <- as.xts(templateTimes) creates a zero-width xts object (i.e. the coredata is a zero-length vector, but there is a non-zero-length index). So, the to.period(templateTimes) call returns OHLC data of random memory loc

Re: [Rd] Reading many large files causes R to crash - Possible Bug in R 2.15.1 64-bit Ubuntu

2012-07-23 Thread David Terk
I'm attaching a runnable script and corresponding data files. This will freeze at 83%. I'm not sure how much simpler to get than this. -Original Message- From: Joshua Ulrich [mailto:josh.m.ulr...@gmail.com] Sent: Monday, July 23, 2012 9:17 AM To: David Terk Cc: Duncan Murdoch; r-devel@

Re: [Rd] Reading many large files causes R to crash - Possible Bug in R 2.15.1 64-bit Ubuntu

2012-07-23 Thread David Terk
Where should this be discussed since it is definitely XTS related? I will gladly upload the simplified script + data files to whoever is maintaining this part of the code. Fortunately there is a workaround here. -Original Message- From: Joshua Ulrich [mailto:josh.m.ulr...@gmail.com] Sen

Re: [Rd] Reading many large files causes R to crash - Possible Bug in R 2.15.1 64-bit Ubuntu

2012-07-23 Thread Joshua Ulrich
Well, you still haven't convinced anyone but yourself that it's definitely an xts problem, since you have not provided any reproducible example... -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Mon, Jul 23, 2012 at 8:14 AM, David Terk wrote: > Where should thi

Re: [Rd] duplicated() variation that goes both ways to capture all duplicates

2012-07-23 Thread Duncan Murdoch
On 23/07/2012 8:49 AM, Liviu Andronic wrote: Dear all The trouble with the current duplicated() function in is that it can report duplicates while searching fromFirst _or_ fromLast, but not both ways. Often users will want to identify and extract all the copies of the item that has duplicates, no

[Rd] duplicated() variation that goes both ways to capture all duplicates

2012-07-23 Thread Liviu Andronic
Dear all The trouble with the current duplicated() function in is that it can report duplicates while searching fromFirst _or_ fromLast, but not both ways. Often users will want to identify and extract all the copies of the item that has duplicates, not only the duplicates themselves. To take the

Re: [Rd] Reading many large files causes R to crash - Possible Bug in R 2.15.1 64-bit Ubuntu

2012-07-23 Thread Joshua Ulrich
David, You still haven't provided a reproducible example. As Duncan already said, "if you don't post code that allows us to reproduce the crash, it's really unlikely that we'll be able to fix it." And R-devel is not the appropriate venue to discuss this if it's truly an issue with xts/zoo. Best

Re: [Rd] Reading many large files causes R to crash - Possible Bug in R 2.15.1 64-bit Ubuntu

2012-07-23 Thread David Terk
Looks like the call to: dat.i <- to.period(dat.i, period=per, k=subper, name=NULL) If what is causing the issue. If variable name is not set, or set to any value other than NULL. Than no hang occurs. -Original Message- From: David Terk [mailto:david.t...@gmail.com] Sent: Monday, Jul

Re: [Rd] Reading many large files causes R to crash - Possible Bug in R 2.15.1 64-bit Ubuntu

2012-07-23 Thread David Terk
I've isolated the bug. When the seg fault was produced there was an error that memory had not been mapped. Here is the odd part of the bug. If you comment out certain code and get a full run than comment in the code which is causing the problem it will actually run. So I think it is safe to as