Re: [R] R package dev: how to export constant?

2012-01-25 Thread cgenolin
Hi Jonas, hi the list

 Try adding
   LazyData: yes
 to the DESCRIPTION file. 

I am a bit surprise by this answer since I found in writing R extentions,
that lazydata is ignore since version 2.14.
But I have the same problem, I do not manage to export contants. So how can
I do that? 

My constant is MAX_CLUST - 26. 

Shall I define it in a code in the /R/ directories, or in a /data/
directories? I try both, neither works...
Shall I mention it in NAMESPACE? How? 
Is there a way to make this constant available as soon as the package will
be loaded without using data()?

Thanks
Christophe

--
View this message in context: 
http://r.789695.n4.nabble.com/R-package-dev-how-to-export-constant-tp4305281p4326840.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R package dev: how to export constant?

2012-01-25 Thread Uwe Ligges



On 25.01.2012 11:17, cgenolin wrote:

Hi Jonas, hi the list


Try adding
   LazyData: yes
to the DESCRIPTION file.


I am a bit surprise by this answer since I found in writing R extentions,
that lazydata is ignore since version 2.14.


LazyLoad is ignored, LazyData is not.



But I have the same problem, I do not manage to export contants. So how can
I do that?

My constant is MAX_CLUST- 26.

Shall I define it in a code in the /R/ directories, or in a /data/
directories? I try both, neither works...
Shall I mention it in NAMESPACE? How?

Is there a way to make this constant available as soon as the package will
be loaded without using data()?



Either in Data and say
LazyData: yes

or in the code and export the object from the NAMESPACE, if you need it 
outside the NAMESPACE.


Since the constant from above is probbaly only used within the 
NAMESPACE; I'd define it in the ./R/ folder in an .R file without 
exporting it form the NAMESPACE.


Uwe Ligges






Thanks
Christophe

--
View this message in context: 
http://r.789695.n4.nabble.com/R-package-dev-how-to-export-constant-tp4305281p4326840.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R package dev: how to export constant?

2012-01-25 Thread cgenolin




Either in Data and say
LazyData: yes


It works, thanks a lot.


Since the constant from above is probbaly only used within the NAMESPACE;


No, I am write four package. The first is all the tools used by the 
three others. It includes the constants, so the others needs to see 
them.









Thanks
Christophe

--
View this message in context: 
http://r.789695.n4.nabble.com/R-package-dev-how-to-export-constant-tp4305281p4326840.html

Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R package dev: how to export constant?

2012-01-20 Thread Uwe Ligges

So you are still unable to cite the previous part of the thread?


On 19.01.2012 00:13, Jonas Stein wrote:

Jonas, I've just seen your function 'sistring' code and it's different from
the code in


Thanks a lot for reporting this bug. It is fixed now in the git
repository.

I added some examples, but they do not work:

R CMD check sitools

= snip

### ** Examples

library(sitools)


We do not know the details about that package



# volume of a dice in metres
a- 1 * centi

Error: object 'centi' not found


We do not know hoe you tried to make that object available now.


= snap

Any hints?


No, given you do not manage to tell us how your setup looks like now.



Do you think i should rename the convert function


Which convert function? You do not call such a function in the example 
you gave above, do you?


Uwe Ligges



to float2si or something like that?
Perhaps someone needs a si2float converter in future...

Betatesters are welcome. After some more testing i want to upload the
package to the R package collection.

kind regards,



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R package dev: how to export constant?

2012-01-19 Thread Jonas Stein
 Jonas, I've just seen your function 'sistring' code and it's different from
 the code in

Thanks a lot for reporting this bug. It is fixed now in the git 
repository.

I added some examples, but they do not work:

R CMD check sitools

= snip
 ### ** Examples
 
 library(sitools)
 
 # volume of a dice in metres
 a - 1 * centi
Error: object 'centi' not found
= snap

Any hints?
Do you think i should rename the convert function to 
float2si or something like that?
Perhaps someone needs a si2float converter in future...

Betatesters are welcome. After some more testing i want to upload the 
package to the R package collection.

kind regards,

-- 
Jonas Stein n...@jonasstein.de

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R package dev: how to export constant?

2012-01-18 Thread Jonas Stein
On 2012-01-18, William Dunlap wdun...@tibco.com wrote:
 Try adding
   LazyData: yes
 to the DESCRIPTION file.
 [3] https://github.com/jonasstein/sitools

Thank you. Now it works and I could add all SI prefixes.


-- 
Jonas Stein n...@jonasstein.de

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R package dev: how to export constant?

2012-01-17 Thread Jonas Stein
Hi,
i create two constants kilo and milli in [1]. These should be available
after loading 

library(sitools)

How should i export them and what have i done wrong?
(Other suggestions for improving the package are welcome too)

The ready to use .tar.gz and the source can be found on github [2,3]

kind regatds,

[1] https://github.com/jonasstein/sitools/blob/master/init.R
[2] https://github.com/jonasstein/sitools/downloads
[3] https://github.com/jonasstein/sitools

-- 
Jonas Stein n...@jonasstein.de

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R package dev: how to export constant?

2012-01-17 Thread William Dunlap
Try adding
  LazyData: yes
to the DESCRIPTION file.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf Of Jonas Stein
 Sent: Tuesday, January 17, 2012 4:41 PM
 To: r-h...@stat.math.ethz.ch
 Subject: [R] R package dev: how to export constant?
 
 Hi,
 i create two constants kilo and milli in [1]. These should be available
 after loading
 
 library(sitools)
 
 How should i export them and what have i done wrong?
 (Other suggestions for improving the package are welcome too)
 
 The ready to use .tar.gz and the source can be found on github [2,3]
 
 kind regatds,
 
 [1] https://github.com/jonasstein/sitools/blob/master/init.R
 [2] https://github.com/jonasstein/sitools/downloads
 [3] https://github.com/jonasstein/sitools
 
 --
 Jonas Stein n...@jonasstein.de
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R package dev: how to export constant?

2012-01-17 Thread Rui Barradas
Hello,

Jonas, I've just seen your function 'sistring' code and it's different from
the code in

R-help, Ben.BigHair, Jan 06, 2012 reply to the thread automatic SI prefixes
as ticklabels on axis.

The difference is that it's not as.character(x), it should be
as.character(number)

(The function parameter's name has changed...)

Rui Barradas


--
View this message in context: 
http://r.789695.n4.nabble.com/R-package-dev-how-to-export-constant-tp4305281p4305569.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.