Dear all,
Currently, I am trying to create a test package "testS4" using S4 classes,
which I am attaching.
Running R CMD check gives the following error:
coeurebooks-computer:/Volumes/CoreData/CRAN cs$ R CMD check
testS4_0.1.1.tar.gz
* checking for working latex ...sh: line 1: latex: command not found
NO
* using log directory '/Volumes/CoreData/CRAN/testS4.Rcheck'
* using R version 2.5.0 Under development (unstable) (2007-02-26 r40806)
* checking for file 'testS4/DESCRIPTION' ... OK
* this is package 'testS4' version '0.1.1'
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking whether package 'testS4' can be installed ... OK
* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... ERROR
Error in library.dynam(lib, package, package.lib) :
shared library 'testS4' not found
Error: package/namespace load failed for 'testS4'
Execution halted
Can someone explain what this error means?
What is meant with "shared library"?
For another test package I get the following error
coeurebooks-computer:/Volumes/CoreData/CRAN cs$ R CMD INSTALL -l
~/Library/R/library mytest_0.3.2.tar.gz
* Installing *source* package 'mytest' ...
** R
** save image
Error in setMethod("export", "derivedClass", export.derivedClass) :
no existing definition for function "export"
Error: unable to load R code in package 'mytest'
Execution halted
This error is even more strange since I cannot reproduce it in the
attached package.
What may be the reason for this error?
Thank you in advance.
Best regards
Christian
_._._._._._._._._._._._._._._._
C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a
V.i.e.n.n.a A.u.s.t.r.i.a
_._._._._._._._._._._._._._._._
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testS4_0.1.1.tar.gz
Type: application/x-gzip
Size: 3180 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-devel/attachments/20070316/d4ef7ed7/attachment.gz
Problems with package containing S4 classes
11 messages · Benilton Carvalho, cstrato
your namespace probably contains: useDynLib(testS4) but you don't have any compiled code... remove that line and everything will be fine. btw, if you're playing with S4, you must import 'methods' b
On Mar 16, 2007, at 4:55 PM, cstrato wrote:
Dear all,
Currently, I am trying to create a test package "testS4" using S4
classes,
which I am attaching.
Running R CMD check gives the following error:
coeurebooks-computer:/Volumes/CoreData/CRAN cs$ R CMD check
testS4_0.1.1.tar.gz
* checking for working latex ...sh: line 1: latex: command not found
NO
* using log directory '/Volumes/CoreData/CRAN/testS4.Rcheck'
* using R version 2.5.0 Under development (unstable) (2007-02-26
r40806)
* checking for file 'testS4/DESCRIPTION' ... OK
* this is package 'testS4' version '0.1.1'
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking whether package 'testS4' can be installed ... OK
* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... ERROR
Error in library.dynam(lib, package, package.lib) :
shared library 'testS4' not found
Error: package/namespace load failed for 'testS4'
Execution halted
Can someone explain what this error means?
What is meant with "shared library"?
For another test package I get the following error
coeurebooks-computer:/Volumes/CoreData/CRAN cs$ R CMD INSTALL -l ~/
Library/R/library mytest_0.3.2.tar.gz
* Installing *source* package 'mytest' ...
** R
** save image
Error in setMethod("export", "derivedClass", export.derivedClass) :
no existing definition for function "export"
Error: unable to load R code in package 'mytest'
Execution halted
This error is even more strange since I cannot reproduce it in the
attached package.
What may be the reason for this error?
Thank you in advance.
Best regards
Christian
_._._._._._._._._._._._._._._._
C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a
V.i.e.n.n.a A.u.s.t.r.i.a
_._._._._._._._._._._._._._._._
<testS4_0.1.1.tar.gz>
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Dear Benilton
Thank you, now my package works.
Do you have an explanation for my second problem:
* Installing *source* package 'mytest' ...
** R
** save image
Error in setMethod("export", "derivedClass", export.derivedClass) :
no existing definition for function "export"
Error: unable to load R code in package 'mytest'
Execution halted
What may be the reason for this error?
Best regards
Christian
Benilton Carvalho wrote:
your namespace probably contains: useDynLib(testS4) but you don't have any compiled code... remove that line and everything will be fine. btw, if you're playing with S4, you must import 'methods' b On Mar 16, 2007, at 4:55 PM, cstrato wrote:
Dear all,
Currently, I am trying to create a test package "testS4" using S4
classes,
which I am attaching.
Running R CMD check gives the following error:
coeurebooks-computer:/Volumes/CoreData/CRAN cs$ R CMD check
testS4_0.1.1.tar.gz
* checking for working latex ...sh: line 1: latex: command not found
NO
* using log directory '/Volumes/CoreData/CRAN/testS4.Rcheck'
* using R version 2.5.0 Under development (unstable) (2007-02-26 r40806)
* checking for file 'testS4/DESCRIPTION' ... OK
* this is package 'testS4' version '0.1.1'
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking whether package 'testS4' can be installed ... OK
* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... ERROR
Error in library.dynam(lib, package, package.lib) :
shared library 'testS4' not found
Error: package/namespace load failed for 'testS4'
Execution halted
Can someone explain what this error means?
What is meant with "shared library"?
For another test package I get the following error
coeurebooks-computer:/Volumes/CoreData/CRAN cs$ R CMD INSTALL -l
~/Library/R/library mytest_0.3.2.tar.gz
* Installing *source* package 'mytest' ...
** R
** save image
Error in setMethod("export", "derivedClass", export.derivedClass) :
no existing definition for function "export"
Error: unable to load R code in package 'mytest'
Execution halted
This error is even more strange since I cannot reproduce it in the
attached package.
What may be the reason for this error?
Thank you in advance.
Best regards
Christian
_._._._._._._._._._._._._._._._
C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a
V.i.e.n.n.a A.u.s.t.r.i.a
_._._._._._._._._._._._._._._._
<testS4_0.1.1.tar.gz>
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
do you have a generic for 'export'?
On Mar 16, 2007, at 5:38 PM, cstrato wrote:
Dear Benilton
Thank you, now my package works.
Do you have an explanation for my second problem:
* Installing *source* package 'mytest' ...
** R
** save image
Error in setMethod("export", "derivedClass", export.derivedClass) :
no existing definition for function "export"
Error: unable to load R code in package 'mytest'
Execution halted
What may be the reason for this error?
Best regards
Christian
Benilton Carvalho wrote:
your namespace probably contains: useDynLib(testS4) but you don't have any compiled code... remove that line and everything will be fine. btw, if you're playing with S4, you must import 'methods' b On Mar 16, 2007, at 4:55 PM, cstrato wrote:
Dear all,
Currently, I am trying to create a test package "testS4" using S4
classes,
which I am attaching.
Running R CMD check gives the following error:
coeurebooks-computer:/Volumes/CoreData/CRAN cs$ R CMD check
testS4_0.1.1.tar.gz
* checking for working latex ...sh: line 1: latex: command not found
NO
* using log directory '/Volumes/CoreData/CRAN/testS4.Rcheck'
* using R version 2.5.0 Under development (unstable) (2007-02-26
r40806)
* checking for file 'testS4/DESCRIPTION' ... OK
* this is package 'testS4' version '0.1.1'
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking whether package 'testS4' can be installed ... OK
* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... ERROR
Error in library.dynam(lib, package, package.lib) :
shared library 'testS4' not found
Error: package/namespace load failed for 'testS4'
Execution halted
Can someone explain what this error means?
What is meant with "shared library"?
For another test package I get the following error
coeurebooks-computer:/Volumes/CoreData/CRAN cs$ R CMD INSTALL -l
~/Library/R/library mytest_0.3.2.tar.gz
* Installing *source* package 'mytest' ...
** R
** save image
Error in setMethod("export", "derivedClass", export.derivedClass) :
no existing definition for function "export"
Error: unable to load R code in package 'mytest'
Execution halted
This error is even more strange since I cannot reproduce it in
the attached package.
What may be the reason for this error?
Thank you in advance.
Best regards
Christian
_._._._._._._._._._._._._._._._
C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a
V.i.e.n.n.a A.u.s.t.r.i.a
_._._._._._._._._._._._._._._._
<testS4_0.1.1.tar.gz>
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Dear Benilton
Yes, but the error disappears only when I define it twice.
For my package I create three files:
1. MyClasses.R:
Here I define the classes only using
setClass("baseClass")
setClass("derivedClass")
2. methods.baseClass.R
Here I define the methods for baseClass
setGeneric("export", function(object,...) standardGeneric("export"))
setMethod("export", "baseClass", export.baseClass);
3. methods.derivedClass.R
Here I define the methods for derivedClass
setGeneric("export", function(object,...) standardGeneric("export"))
setMethod("export", "derivedClass", export.derivedClass);
As you see, I need to define setGeneric twice, otherwise I get the error.
It is not clear to me, why this is the case?
I know, that BioBase has a file AllGeneric.R, but I would like to define
the generics in the respective methods files.
Best regards
Christian
Benilton Carvalho wrote:
do you have a generic for 'export'? On Mar 16, 2007, at 5:38 PM, cstrato wrote:
Dear Benilton
Thank you, now my package works.
Do you have an explanation for my second problem:
* Installing *source* package 'mytest' ...
** R
** save image
Error in setMethod("export", "derivedClass", export.derivedClass) :
no existing definition for function "export"
Error: unable to load R code in package 'mytest'
Execution halted
What may be the reason for this error?
Best regards
Christian
Well, my understanding is that if you "need" to define it (the generic) twice you're doing something wrong. Do you have a collate field in your description file? IMHO, the "AllGeneric.R"/"AllClasses.R" approach is the way to go... keeping your code organized is always a good thing, right? b
On Mar 16, 2007, at 6:35 PM, cstrato wrote:
Dear Benilton
Yes, but the error disappears only when I define it twice.
For my package I create three files:
1. MyClasses.R:
Here I define the classes only using
setClass("baseClass")
setClass("derivedClass")
2. methods.baseClass.R
Here I define the methods for baseClass
setGeneric("export", function(object,...) standardGeneric("export"))
setMethod("export", "baseClass", export.baseClass);
3. methods.derivedClass.R
Here I define the methods for derivedClass
setGeneric("export", function(object,...) standardGeneric("export"))
setMethod("export", "derivedClass", export.derivedClass);
As you see, I need to define setGeneric twice, otherwise I get the
error.
It is not clear to me, why this is the case?
I know, that BioBase has a file AllGeneric.R, but I would like to
define
the generics in the respective methods files.
Best regards
Christian
Benilton Carvalho wrote:
do you have a generic for 'export'? On Mar 16, 2007, at 5:38 PM, cstrato wrote:
Dear Benilton
Thank you, now my package works.
Do you have an explanation for my second problem:
* Installing *source* package 'mytest' ...
** R
** save image
Error in setMethod("export", "derivedClass", export.derivedClass) :
no existing definition for function "export"
Error: unable to load R code in package 'mytest'
Execution halted
What may be the reason for this error?
Best regards
Christian
I agree, but I hope that "AllGeneric.R" is not the only possibility. BTW, what is a collate field? Best regards Christian
Benilton Carvalho wrote:
Well, my understanding is that if you "need" to define it (the generic) twice you're doing something wrong. Do you have a collate field in your description file? IMHO, the "AllGeneric.R"/"AllClasses.R" approach is the way to go... keeping your code organized is always a good thing, right? b On Mar 16, 2007, at 6:35 PM, cstrato wrote:
Dear Benilton
Yes, but the error disappears only when I define it twice.
For my package I create three files:
1. MyClasses.R:
Here I define the classes only using
setClass("baseClass")
setClass("derivedClass")
2. methods.baseClass.R
Here I define the methods for baseClass
setGeneric("export", function(object,...) standardGeneric("export"))
setMethod("export", "baseClass", export.baseClass);
3. methods.derivedClass.R
Here I define the methods for derivedClass
setGeneric("export", function(object,...) standardGeneric("export"))
setMethod("export", "derivedClass", export.derivedClass);
As you see, I need to define setGeneric twice, otherwise I get the
error.
It is not clear to me, why this is the case?
I know, that BioBase has a file AllGeneric.R, but I would like to define
the generics in the respective methods files.
Best regards
Christian
Benilton Carvalho wrote:
do you have a generic for 'export'? On Mar 16, 2007, at 5:38 PM, cstrato wrote:
Dear Benilton
Thank you, now my package works.
Do you have an explanation for my second problem:
* Installing *source* package 'mytest' ...
** R
** save image
Error in setMethod("export", "derivedClass", export.derivedClass) :
no existing definition for function "export"
Error: unable to load R code in package 'mytest'
Execution halted
What may be the reason for this error?
Best regards
Christian
The Collate field gives the order that the files are going to be concatenated. If they're concatenated using the "wrong" order, your installation might fail (for example, the generic is defined after the method). A recommended source is the "Writing R Extensions" http://cran.r-project.org/doc/manuals/R-exts.html Session 1.1.1 - The Description File (Writing R Extensions) says exactly what you shohuld know about the Collate field (and not only that). b
On Mar 16, 2007, at 7:01 PM, cstrato wrote:
I agree, but I hope that "AllGeneric.R" is not the only possibility. BTW, what is a collate field? Best regards Christian Benilton Carvalho wrote:
Well, my understanding is that if you "need" to define it (the generic) twice you're doing something wrong. Do you have a collate field in your description file? IMHO, the "AllGeneric.R"/"AllClasses.R" approach is the way to go... keeping your code organized is always a good thing, right? b On Mar 16, 2007, at 6:35 PM, cstrato wrote:
Dear Benilton
Yes, but the error disappears only when I define it twice.
For my package I create three files:
1. MyClasses.R:
Here I define the classes only using
setClass("baseClass")
setClass("derivedClass")
2. methods.baseClass.R
Here I define the methods for baseClass
setGeneric("export", function(object,...) standardGeneric("export"))
setMethod("export", "baseClass", export.baseClass);
3. methods.derivedClass.R
Here I define the methods for derivedClass
setGeneric("export", function(object,...) standardGeneric("export"))
setMethod("export", "derivedClass", export.derivedClass);
As you see, I need to define setGeneric twice, otherwise I get
the error.
It is not clear to me, why this is the case?
I know, that BioBase has a file AllGeneric.R, but I would like to
define
the generics in the respective methods files.
Best regards
Christian
Benilton Carvalho wrote:
do you have a generic for 'export'? On Mar 16, 2007, at 5:38 PM, cstrato wrote:
Dear Benilton
Thank you, now my package works.
Do you have an explanation for my second problem:
* Installing *source* package 'mytest' ...
** R
** save image
Error in setMethod("export", "derivedClass",
export.derivedClass) :
no existing definition for function "export"
Error: unable to load R code in package 'mytest'
Execution halted
What may be the reason for this error?
Best regards
Christian
Thank you, I have already read the R-exts manual, but the collate field is optional. Do you know a package which uses the Collate field so that I can study it? Best regards Christian
Benilton Carvalho wrote:
The Collate field gives the order that the files are going to be concatenated. If they're concatenated using the "wrong" order, your installation might fail (for example, the generic is defined after the method). A recommended source is the "Writing R Extensions" http://cran.r-project.org/doc/manuals/R-exts.html Session 1.1.1 - The Description File (Writing R Extensions) says exactly what you shohuld know about the Collate field (and not only that). b On Mar 16, 2007, at 7:01 PM, cstrato wrote:
Biobase itself does. b
On Mar 16, 2007, at 7:43 PM, cstrato wrote:
Thank you, I have already read the R-exts manual, but the collate field is optional. Do you know a package which uses the Collate field so that I can study it? Best regards Christian Benilton Carvalho wrote:
The Collate field gives the order that the files are going to be concatenated. If they're concatenated using the "wrong" order, your installation might fail (for example, the generic is defined after the method). A recommended source is the "Writing R Extensions" http://cran.r-project.org/doc/manuals/R-exts.html Session 1.1.1 - The Description File (Writing R Extensions) says exactly what you shohuld know about the Collate field (and not only that). b On Mar 16, 2007, at 7:01 PM, cstrato wrote:
I must have missed this, thank you. Good night Christian
Benilton Carvalho wrote:
Biobase itself does. b On Mar 16, 2007, at 7:43 PM, cstrato wrote:
Thank you, I have already read the R-exts manual, but the collate field is optional. Do you know a package which uses the Collate field so that I can study it? Best regards Christian Benilton Carvalho wrote:
The Collate field gives the order that the files are going to be concatenated. If they're concatenated using the "wrong" order, your installation might fail (for example, the generic is defined after the method). A recommended source is the "Writing R Extensions" http://cran.r-project.org/doc/manuals/R-exts.html Session 1.1.1 - The Description File (Writing R Extensions) says exactly what you shohuld know about the Collate field (and not only that). b On Mar 16, 2007, at 7:01 PM, cstrato wrote: