Re: [Rd] S3 objects in S4 slots

2009-09-15 Thread Martin Kober
2009/9/15 John Chambers : > I'll look at this in more detail (though not for a few days), but the > essence I think is that nothing in the current version allows one to say the > S3 equivalent of > > setClass("VCorpus", contains = "list", ) > > Seems a (minor, I hope) glitch that what Martin K.

Re: [Rd] Building R package with .c sub-routine files

2009-09-15 Thread Kjell Konis
Create a file named Makevars in the same directory and put the following line in it: OBJECTS=file1.o Then R CMD SHLIB will only compile file1.c. Kjell On Sep 15, 2009, at 8:04 PM, pleyd...@supagro.inra.fr wrote: Lets say I have two source files file1.c and file2.c The latter just contain

Re: [Rd] Building R package with .c sub-routine files

2009-09-15 Thread Duncan Murdoch
On 9/15/2009 2:04 PM, pleyd...@supagro.inra.fr wrote: Lets say I have two source files file1.c and file2.c The latter just contains sub-routines to be used by the first. i.e. in file1.c I have the line #include "file2.c" That's not the normal way to program in C: normally you'd have a sepa

[Rd] Building R package with .c sub-routine files

2009-09-15 Thread pleydell
Lets say I have two source files file1.c and file2.c The latter just contains sub-routines to be used by the first. i.e. in file1.c I have the line #include "file2.c" Let's say "R CMD SHLIB file1.c" runs perfectly and I want to include the code in a package, "R CMD build" also runs fine but R

Re: [Rd] S3 objects in S4 slots

2009-09-15 Thread John Chambers
I'll look at this in more detail (though not for a few days), but the essence I think is that nothing in the current version allows one to say the S3 equivalent of setClass("VCorpus", contains = "list", ) Seems a (minor, I hope) glitch that what Martin K. tried didn't work: setOldClass

Re: [Rd] S3 objects in S4 slots

2009-09-15 Thread Martin Morgan
Hi Martin Kober -- Martin Kober wrote: > Hello, > > I am the maintainer of the stringkernels package and have come across > a problem with using S3 objects in my S4 classes. > > Specifically, I have an S4 class with a slot that takes a text corpus > as a list of character vectors. tm (version 0.

Re: [Rd] Clarifications please.

2009-09-15 Thread Abhijit Bera
I'm trying to create this object in C SWX.RET[1:6,c("SBI,"SPI","SII")] While i am able to access and use a simple SWX.RET object, I'm getting confused on how to create an object with the array subscripts like above. Here is what I tried to do. It doesn't work becase [ is obviously not an operati

Re: [Rd] S3 objects in S4 slots

2009-09-15 Thread Duncan Murdoch
On 15/09/2009 7:34 AM, Martin Maechler wrote: Duncan Murdoch on Tue, 15 Sep 2009 06:26:32 -0400 writes: > Martin Kober wrote: >> Hello, >> >> I am the maintainer of the stringkernels package and have come across >> a problem with using S3 objects in my S4 classes.

Re: [Rd] S3 objects in S4 slots

2009-09-15 Thread Martin Maechler
> Duncan Murdoch > on Tue, 15 Sep 2009 06:26:32 -0400 writes: > Martin Kober wrote: >> Hello, >> >> I am the maintainer of the stringkernels package and have come across >> a problem with using S3 objects in my S4 classes. >> >> Specifically, I have an S4

Re: [Rd] S3 objects in S4 slots

2009-09-15 Thread Duncan Murdoch
Martin Kober wrote: Hello, I am the maintainer of the stringkernels package and have come across a problem with using S3 objects in my S4 classes. Specifically, I have an S4 class with a slot that takes a text corpus as a list of character vectors. tm (version 0.5) saves corpora as lists with a

[Rd] S3 objects in S4 slots

2009-09-15 Thread Martin Kober
Hello, I am the maintainer of the stringkernels package and have come across a problem with using S3 objects in my S4 classes. Specifically, I have an S4 class with a slot that takes a text corpus as a list of character vectors. tm (version 0.5) saves corpora as lists with a class attribute of c(

Re: [Rd] Clarifications please.

2009-09-15 Thread Abhijit Bera
Hi I have confusion in evaluating this expression using C. It's similar to my previous expression with the addition of row and column specifiers. I'm confused how to create such objects. Covariance <- round(cov(100 * SWX.RET[1:6,c("SBI","SPI","SII")]), I thought of creating vectors for 1:6 and c