[Rd] Depends/Imports/Suggest/Enhence
Hi the list In the DESCRIPTION file of my package foo0, I have: Depends: foo1 Imports: foo2 Suggest: foo3 Enhence: foo4 If I understand correctly, to install foo0 on my computer, I need to already have foo1, foo2, foo3. foo4 is not necessary. I my R sesssion, when I will write: library(foo0), then the package foo1 will be attach. foo2, foo3 and foo4 will not. Is that correct? But what is the difference between Import and Suggest? Christophe -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du campus Université Paris Ouest Nanterre La Défense [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On Nov 6, 2012, at 11:19 AM, Christophe Genolini wrote: > Hi the list > > In the DESCRIPTION file of my package foo0, I have: > > Depends: foo1 > Imports: foo2 > Suggest: foo3 > Enhence: foo4 > (it is really "Suggests" and "Enhances" - the above are typos I presume and thus won't be recognized) > If I understand correctly, to install foo0 on my computer, I need to already > have foo1, foo2, foo3. > foo4 is not necessary. > No, you only need foo1 and foo2. The other two are optional. > I my R sesssion, when I will write: library(foo0), then the package foo1 will > be attach. foo2, foo3 > and foo4 will not. Is that correct? > Yes > But what is the difference between Import and Suggest? > "Imports" means that symbols are imported form the namespace, so they are mandatory for the package to operate. "Suggests" means that symbols from the package are not required, but they are used in examples or vignettes, so the listed package(s) will be needed for a full check. They are not needed for the operation of the package, though. Cheers, Simon > Christophe > > -- > Christophe Genolini > Maître de conférences en bio-statistique > Vice président Communication interne et animation du campus > Université Paris Ouest Nanterre La Défense > > > [[alternative HTML version deleted]] > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
Thanks a lot for your answer. (it is really "Suggests" and "Enhances" - the above are typos I presume and thus won't be recognized) Yes, it was typo. Sorry No, you only need foo1 and foo2. The other two are optional. I get: * checking package dependencies ... ERROR Package suggested but not available: 'foo3' "Imports" means that symbols are imported form the namespace, so they are mandatory for the package to operate. "Suggests" means that symbols from the package are not required, but they are used in examples or vignettes, so the listed package(s) will be needed for a full check. They are not needed for the operation of the package, though. That's very clear, thanks a lot. So I will use - 'Depends:foo1' if there is a function in foo1 that my package use often - 'Imports:foo2' if there is a function in foo2 that my package might use rarely - 'Suggest:foo3' if an example .Rd in foo0 needs a function in foo3 Right? Cheers, Simon Christophe -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du campus Université Paris Ouest Nanterre La Défense [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du campus Université Paris Ouest Nanterre La Défense __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On Nov 6, 2012, at 10:36 AM, Simon Urbanek wrote: > > On Nov 6, 2012, at 11:19 AM, Christophe Genolini wrote: > >> Hi the list >> >> In the DESCRIPTION file of my package foo0, I have: >> >> Depends: foo1 >> Imports: foo2 >> Suggest: foo3 >> Enhence: foo4 >> > > (it is really "Suggests" and "Enhances" - the above are typos I presume and > thus won't be recognized) > > >> If I understand correctly, to install foo0 on my computer, I need to already >> have foo1, foo2, foo3. >> foo4 is not necessary. >> > > No, you only need foo1 and foo2. The other two are optional. Just to add another option here, you need not have foo1 and foo2 already installed to install foo0. You can use: install.packages("foo0", dependencies = TRUE) and that will install foo1 and foo2 at the same time. 'dependencies' defaults to FALSE. See ?install.packages for more info. Regards, Marc Schwartz > >> I my R sesssion, when I will write: library(foo0), then the package foo1 >> will be attach. foo2, foo3 >> and foo4 will not. Is that correct? >> > > Yes > > >> But what is the difference between Import and Suggest? >> > > "Imports" means that symbols are imported form the namespace, so they are > mandatory for the package to operate. "Suggests" means that symbols from the > package are not required, but they are used in examples or vignettes, so the > listed package(s) will be needed for a full check. They are not needed for > the operation of the package, though. > > Cheers, > Simon > > >> Christophe __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On Nov 6, 2012, at 11:00 AM, Marc Schwartz wrote: > > On Nov 6, 2012, at 10:36 AM, Simon Urbanek > wrote: > >> >> On Nov 6, 2012, at 11:19 AM, Christophe Genolini wrote: >> >>> Hi the list >>> >>> In the DESCRIPTION file of my package foo0, I have: >>> >>> Depends: foo1 >>> Imports: foo2 >>> Suggest: foo3 >>> Enhence: foo4 >>> >> >> (it is really "Suggests" and "Enhances" - the above are typos I presume and >> thus won't be recognized) >> >> >>> If I understand correctly, to install foo0 on my computer, I need to >>> already have foo1, foo2, foo3. >>> foo4 is not necessary. >>> >> >> No, you only need foo1 and foo2. The other two are optional. > > > Just to add another option here, you need not have foo1 and foo2 already > installed to install foo0. You can use: > > install.packages("foo0", dependencies = TRUE) > > and that will install foo1 and foo2 at the same time. 'dependencies' defaults > to FALSE. See ?install.packages for more info. Actually, a correction here. 'dependencies' defaults to NA, which will handle Depends, Imports and LinkingTo for the packages explicitly listed in the 'pkgs' argument. TRUE adds handling for Suggests in the packages listed in the 'pkgs' argument and then additional Depends, Imports and LinkingTo in other packages brought in as further dependencies. So if you get into nested package dependencies, you would want to use this. Marc > > Regards, > > Marc Schwartz > > >> >>> I my R sesssion, when I will write: library(foo0), then the package foo1 >>> will be attach. foo2, foo3 >>> and foo4 will not. Is that correct? >>> >> >> Yes >> >> >>> But what is the difference between Import and Suggest? >>> >> >> "Imports" means that symbols are imported form the namespace, so they are >> mandatory for the package to operate. "Suggests" means that symbols from the >> package are not required, but they are used in examples or vignettes, so the >> listed package(s) will be needed for a full check. They are not needed for >> the operation of the package, though. >> >> Cheers, >> Simon >> >> >>> Christophe > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On Nov 6, 2012, at 10:55 AM, Christophe Genolini wrote: > Thanks a lot for your answer. > >> (it is really "Suggests" and "Enhances" - the above are typos I presume and >> thus won't be recognized) > Yes, it was typo. Sorry >> No, you only need foo1 and foo2. The other two are optional. > I get: > > * checking package dependencies ... ERROR > Package suggested but not available: 'foo3' This is presumably coming from: R CMD check foo0 'foo3', as a 'Suggests', is not needed to install 'foo0' for an end user of your package 'foo0'. However, 'foo3' is required to run R CMD check on 'foo0' when you are testing your package to be sure that it passes all checks. This includes testing for the presence of the packages you indicate in the DESCRIPTION file as well as running examples in your .Rd files. Regards, Marc > >> "Imports" means that symbols are imported form the namespace, so they are >> mandatory for the package to operate. "Suggests" means that symbols from the >> package are not required, but they are used in examples or vignettes, so the >> listed package(s) will be needed for a full check. They are not needed for >> the operation of the package, though. > That's very clear, thanks a lot. > So I will use > > > - 'Depends:foo1' if there is a function in foo1 that my package use often > - 'Imports:foo2' if there is a function in foo2 that my package might use > rarely > - 'Suggest:foo3' if an example .Rd in foo0 needs a function in foo3 > > Right? > >> Cheers, Simon >>> Christophe __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On 06.11.2012 17:55, Christophe Genolini wrote: Thanks a lot for your answer. (it is really "Suggests" and "Enhances" - the above are typos I presume and thus won't be recognized) Yes, it was typo. Sorry No, you only need foo1 and foo2. The other two are optional. I get: * checking package dependencies ... ERROR Package suggested but not available: 'foo3' "Imports" means that symbols are imported form the namespace, so they are mandatory for the package to operate. "Suggests" means that symbols from the package are not required, but they are used in examples or vignettes, so the listed package(s) will be needed for a full check. They are not needed for the operation of the package, though. That's very clear, thanks a lot. So I will use - 'Depends:foo1' if there is a function in foo1 that my package use often No, better make use of Namespace imports all the time and only use "Depends" if you really need the other package to be installed. This is rarely needed. Uwe Ligges - 'Imports:foo2' if there is a function in foo2 that my package might use rarely - 'Suggest:foo3' if an example .Rd in foo0 needs a function in foo3 Right? Cheers, Simon Christophe -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du campus Université Paris Ouest Nanterre La Défense [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] LazyData: no / yes
Hi the list I have package foo0 with a big dataset 'myData'. In DESCRIPTION, if I use 'LazyData: no', then I get: - when I open a R session : memory used=20 908 - when I attach 'library(foo0)' : memory used=24364 - then I load the set 'data(myData)' : memory used=39 668 If I use LazyData: yes', then I get - when I open a R session : memory used=20 908 - when I attach 'library(foo0)' : memory used=52 760. In this second example, after 'library(foo0)', I was expecting the memory to rize up to 39 668, not to 52 760... Where does the difference come from? Thanks Christophe -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du campus Université Paris Ouest Nanterre La Défense __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On 11/06/2012 11:36 AM, Simon Urbanek wrote: > > On Nov 6, 2012, at 11:19 AM, Christophe Genolini wrote: > >> Hi the list >> >> In the DESCRIPTION file of my package foo0, I have: >> >> Depends: foo1 >> Imports: foo2 >> Suggest: foo3 >> Enhence: foo4 > > No, you only need foo1 and foo2. The other two are optional. Unless you want to CHECK the package. In that case, you'll need Suggests, too. - Allen S. Rout __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On 11/06/2012 12:49 PM, Uwe Ligges wrote: > >> >> >> - 'Depends:foo1' if there is a function in foo1 that my package use often > > No, better make use of Namespace imports all the time and only use > "Depends" if you really need the other package to be installed. This is > rarely needed. > Could you discuss this further? It seems counterintuitive to me. I'd expect every package which my package code calls to be a dependency. We're short of vocabulary for the true pedants here, because I could see the vignettes being described as something "my package calls", but I don't mean that. - Allen S. Rout __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] LazyData: no / yes
On Nov 6, 2012, at 1:03 PM, Christophe Genolini wrote: > Hi the list > > I have package foo0 with a big dataset 'myData'. > In DESCRIPTION, if I use 'LazyData: no', then I get: > > - when I open a R session : memory used=20 908 > - when I attach 'library(foo0)' : memory used=24364 > - then I load the set 'data(myData)' : memory used=39 668 > > If I use LazyData: yes', then I get > - when I open a R session : memory used=20 908 > - when I attach 'library(foo0)' : memory used=52 760. > > In this second example, after 'library(foo0)', I was expecting the memory to > rize up to 39 668, not to 52 760... Where does the difference come from? > What do you mean by "memory used" - i.e. where do you get that from? After GC? This certainly doesn't look like a "big dataset" by the numbers - I would classify that as tiny :) Cheers, Simon > Thanks > Christophe > > > -- > Christophe Genolini > Maître de conférences en bio-statistique > Vice président Communication interne et animation du campus > Université Paris Ouest Nanterre La Défense > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On 2012-11-06, at 9:49 AM, Uwe Ligges wrote: > On 06.11.2012 17:55, Christophe Genolini wrote: >> >>> "Imports" means that symbols are imported form the namespace, so they >>> are mandatory for the package to operate. "Suggests" means that >>> symbols from the package are not required, but they are used in >>> examples or vignettes, so the listed package(s) will be needed for a >>> full check. They are not needed for the operation of the package, though. >> That's very clear, thanks a lot. >> So I will use >> >> >> - 'Depends:foo1' if there is a function in foo1 that my package use often > > No, better make use of Namespace imports all the time and only use "Depends" > if you really need the other package to be installed. This is rarely needed. Uwe, did you mean to say "only use 'Depends' if the other package really needs to be *attached*"? Because in terms of determining dependencies for `install.package`, I thought "Imports" and "Depends" are no different. (Unless the user explicitly chooses otherwise in the 'dependencies' argument, that is.) >> - 'Imports:foo2' if there is a function in foo2 that my package might >> use rarely I don't think choosing to declare "Imports" has anything to do with frequency of use. But if you do use it, then don't forget to include "imports(foo2)" or "importsFrom(foo2, ...)" in the NAMESPACE file. Davor __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] unedited copy/paste from install.packages man page to update.packages man page
Hi, Looks like this was addressed in revision 61083, thanks! Note that the example provided for update.packages is still the same i.e. it shows how to use install.packages instead of update.packages. Cheers, H. On 11/01/2012 05:13 PM, Hervé Pagès wrote: Hi, Found in the man page for update.packages: repos: character vector, the base URL(s) of the repositories to use, i.e., the URL of the CRAN master such as ‘"http://cran.r-project.org"’ or its Statlib mirror, ‘"http://lib.stat.cmu.edu/R/CRAN"’.Can be ‘NULL’ to install from local files (‘.tar.gz’ for source packages). - Using "e.g." instead of "i.e." would seem more appropriate. - But more importantly, is repos = NULL really supported for update.packages? I wonder where I need to place the local files for this to work. I tried to put them in the current working directory but that didn't work: > packageVersion("BSgenome") [1] ‘1.27.1’ > dir() [1] "BSgenome_2.0.0.tar.gz" > update.packages(repos=NULL) This description of the 'repos' arg looks more like a copy/paste from the man page for install.packages that needed some edit. - Another copy/paste is the \examples section for update.packages that shows in fact an example for install.packages, which is the same example that is shown in the man page for install.packages. Could those minor things be corrected? Thanks, H. -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpa...@fhcrc.org Phone: (206) 667-5791 Fax:(206) 667-1319 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On Nov 6, 2012, at 2:44 PM, Davor Cubranic wrote: > On 2012-11-06, at 9:49 AM, Uwe Ligges wrote: > >> On 06.11.2012 17:55, Christophe Genolini wrote: >>> "Imports" means that symbols are imported form the namespace, so they are mandatory for the package to operate. "Suggests" means that symbols from the package are not required, but they are used in examples or vignettes, so the listed package(s) will be needed for a full check. They are not needed for the operation of the package, though. >>> That's very clear, thanks a lot. >>> So I will use >>> >>> >>> - 'Depends:foo1' if there is a function in foo1 that my package use often >> >> No, better make use of Namespace imports all the time and only use "Depends" >> if you really need the other package to be installed. This is rarely needed. > > Uwe, did you mean to say "only use 'Depends' if the other package really > needs to be *attached*"? I think so. BTW: this Depends/Imports is an interesting aspect that it may look trivial for package developers, but can be quite confusing for users. Uwe was suggesting Imports over Depends which is clean from a technical point of view (no namespace collisions etc.), but as an R user I have to say I find it bad since I used to be able to just load one package and not have to load (=attach) every package in the dependency tree that I may want to use myself by hand, but if people really decide to go that route, you'll have to do it for every single package which is a real pain. (Also it's a very bad thing for debugging - you can't even ask users to test things since the imports will be hidden). In addition, it hides declared methods which is, again, a pain when using R interactively, since you can't simply check what a certain method definition looks like - you'd have to hunt for it through namespaces (this is also related to not exporting methods). There is a difference in treating R as ! a scripting language versus an interactive analytics system and I find that recently focus has been shifting to the former aspect, while, personally, I think it's actually more useful as the latter. (Just my $0.02 off topic ;)) Cheers, Simon > Because in terms of determining dependencies for `install.package`, I thought > "Imports" and "Depends" are no different. (Unless the user explicitly chooses > otherwise in the 'dependencies' argument, that is.) > >>> - 'Imports:foo2' if there is a function in foo2 that my package might >>> use rarely > > > I don't think choosing to declare "Imports" has anything to do with frequency > of use. But if you do use it, then don't forget to include "imports(foo2)" or > "importsFrom(foo2, ...)" in the NAMESPACE file. > > Davor > > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] mysterious description of download.packages
Hi, \description paragraph in man page for download.packages doesn't seem to have anything to do with download.packages: These functions can be used to automatically compare the version numbers of installed packages with the newest available version on the repositories and update outdated packages on the fly. But maybe I'm missing some secret capabilities of download.packages... Thanks! H. -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpa...@fhcrc.org Phone: (206) 667-5791 Fax:(206) 667-1319 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On 06.11.2012 21:17, Simon Urbanek wrote: On Nov 6, 2012, at 2:44 PM, Davor Cubranic wrote: On 2012-11-06, at 9:49 AM, Uwe Ligges wrote: On 06.11.2012 17:55, Christophe Genolini wrote: "Imports" means that symbols are imported form the namespace, so they are mandatory for the package to operate. "Suggests" means that symbols from the package are not required, but they are used in examples or vignettes, so the listed package(s) will be needed for a full check. They are not needed for the operation of the package, though. That's very clear, thanks a lot. So I will use - 'Depends:foo1' if there is a function in foo1 that my package use often No, better make use of Namespace imports all the time and only use "Depends" if you really need the other package to be installed. This is rarely needed. Uwe, did you mean to say "only use 'Depends' if the other package really needs to be *attached*"? I think so. Yes, sure, sorry for causing confusion. BTW: this Depends/Imports is an interesting aspect that it may look trivial for package developers, but can be quite confusing for users. Uwe was suggesting Imports over Depends which is clean from a technical point of view (no namespace collisions etc.), but as an R user I have to say I find it bad since I used to be able to just load one package and not have to load (=attach) every package in the dependency tree that I may want to use myself by hand, but if people really decide to go that route, you'll have to do it for every single package which is a real pain. (Also it's a very bad thing for debugging - you can't even ask users to test things since the imports will be hidden). In addition, it hides declared methods which is, again, a pain when using R interactively, since you can't simply check what a certain method definition looks like - you'd have to hunt for it through namespaces (this is also related to not exporting methods). There is a difference in treating R as a scri pting language versus an interactive analytics system and I find that recently focus has been shifting to the former aspect, while, personally, I think it's actually more useful as the latter. (Just my $0.02 off topic ;)) Yes, fair enough. From my point of view that shift already started with formal (S4) classes/methods. I still find reading S4 code much more complicated than hunting through namespaces, but that point of view may just be biased by amount of experience in those different aspects. Best, Uwe Cheers, Simon Because in terms of determining dependencies for `install.package`, I thought "Imports" and "Depends" are no different. (Unless the user explicitly chooses otherwise in the 'dependencies' argument, that is.) - 'Imports:foo2' if there is a function in foo2 that my package might use rarely I don't think choosing to declare "Imports" has anything to do with frequency of use. But if you do use it, then don't forget to include "imports(foo2)" or "importsFrom(foo2, ...)" in the NAMESPACE file. Davor __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] \value section for write_PACKAGES not updated
Hi, Found in \value section of man page for tools::write_PACKAGES: Invisibly returns the number of packages described in the resulting \file{PACKAGES} and \file{PACKAGES.gz} files. If \code{0}, no packages were found and no files were written. Those days (don't know when this has changed exactly), PACKAGES and PACKAGES.gz are written, even if no packages were found (which is a good thing BTW). Thanks, H. -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpa...@fhcrc.org Phone: (206) 667-5791 Fax:(206) 667-1319 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Depends/Imports/Suggest/Enhence
On Nov 6, 2012, at 3:43 PM, Uwe Ligges wrote: > > > On 06.11.2012 21:17, Simon Urbanek wrote: >> >> On Nov 6, 2012, at 2:44 PM, Davor Cubranic wrote: >> >>> On 2012-11-06, at 9:49 AM, Uwe Ligges wrote: >>> On 06.11.2012 17:55, Christophe Genolini wrote: > >> "Imports" means that symbols are imported form the namespace, so they >> are mandatory for the package to operate. "Suggests" means that >> symbols from the package are not required, but they are used in >> examples or vignettes, so the listed package(s) will be needed for a >> full check. They are not needed for the operation of the package, though. > That's very clear, thanks a lot. > So I will use > > > - 'Depends:foo1' if there is a function in foo1 that my package use often No, better make use of Namespace imports all the time and only use "Depends" if you really need the other package to be installed. This is rarely needed. >>> >>> Uwe, did you mean to say "only use 'Depends' if the other package really >>> needs to be *attached*"? >> >> I think so. > > Yes, sure, sorry for causing confusion. > > >> BTW: this Depends/Imports is an interesting aspect that it may look trivial >> for package developers, but can be quite confusing for users. Uwe was >> suggesting Imports over Depends which is clean from a technical point of >> view (no namespace collisions etc.), but as an R user I have to say I find >> it bad since I used to be able to just load one package and not have to load >> (=attach) every package in the dependency tree that I may want to use myself >> by hand, but if people really decide to go that route, you'll have to do it >> for every single package which is a real pain. (Also it's a very bad thing >> for debugging - you can't even ask users to test things since the imports >> will be hidden). In addition, it hides declared methods which is, again, a >> pain when using R interactively, since you can't simply check what a certain >> method definition looks like - you'd have to hunt for it through namespaces >> (this is also related to not exporting methods). There is a difference in >> treating R ! as > a scri > pting language versus an interactive analytics system and I find that > recently focus has been shifting to the former aspect, while, personally, I > think it's actually more useful as the latter. (Just my $0.02 off topic ;)) > > Yes, fair enough. From my point of view that shift already started with > formal (S4) classes/methods. I still find reading S4 code much more > complicated than hunting through namespaces, but that point of view may just > be biased by amount of experience in those different aspects. > Yes, no argument there, I won't even start about that aspect of S4 ;) Cheers, Simon > > >> Cheers, >> Simon >> >> >>> Because in terms of determining dependencies for `install.package`, I >>> thought "Imports" and "Depends" are no different. (Unless the user >>> explicitly chooses otherwise in the 'dependencies' argument, that is.) >>> > - 'Imports:foo2' if there is a function in foo2 that my package might > use rarely >>> >>> >>> I don't think choosing to declare "Imports" has anything to do with >>> frequency of use. But if you do use it, then don't forget to include >>> "imports(foo2)" or "importsFrom(foo2, ...)" in the NAMESPACE file. >>> >>> Davor >>> >>> >> > > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] LazyData: no / yes
I get it from windows tack manager (under Window 7). I guess it is in K something. My point was not about "how big is my dataset" (anyway, it is a fake dataset, so it can be as big as I want) but more about "where on hell are lost the 52 760 - 39 668 K ?" :-) Christophe On Nov 6, 2012, at 1:03 PM, Christophe Genolini wrote: Hi the list I have package foo0 with a big dataset 'myData'. In DESCRIPTION, if I use 'LazyData: no', then I get: - when I open a R session : memory used=20 908 - when I attach 'library(foo0)' : memory used=24364 - then I load the set 'data(myData)' : memory used=39 668 If I use LazyData: yes', then I get - when I open a R session : memory used=20 908 - when I attach 'library(foo0)' : memory used=52 760. In this second example, after 'library(foo0)', I was expecting the memory to rize up to 39 668, not to 52 760... Where does the difference come from? What do you mean by "memory used" - i.e. where do you get that from? After GC? This certainly doesn't look like a "big dataset" by the numbers - I would classify that as tiny :) Cheers, Simon Thanks Christophe -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du campus Université Paris Ouest Nanterre La Défense __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du campus Université Paris Ouest Nanterre La Défense __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] LazyData: no / yes
On Nov 6, 2012, at 5:13 PM, Christophe Genolini wrote: > I get it from windows tack manager (under Window 7). I guess it is in K > something. > My point was not about "how big is my dataset" (anyway, it is a fake dataset, > so it can be as big as I want) but more about "where on hell are lost the 52 > 760 - 39 668 K ?" > :-) Ask your system ;) - you're comparing wrong things: a) you didn't run garbage collection so there will be temporary objects around and b) see FAQ 7.42 why what you're looking at has no real meaning. Cheers, Simon > Christophe > >> On Nov 6, 2012, at 1:03 PM, Christophe Genolini wrote: >> >>> Hi the list >>> >>> I have package foo0 with a big dataset 'myData'. >>> In DESCRIPTION, if I use 'LazyData: no', then I get: >>> >>> - when I open a R session : memory used=20 908 >>> - when I attach 'library(foo0)' : memory used=24364 >>> - then I load the set 'data(myData)' : memory used=39 668 >>> >>> If I use LazyData: yes', then I get >>> - when I open a R session : memory used=20 908 >>> - when I attach 'library(foo0)' : memory used=52 760. >>> >>> In this second example, after 'library(foo0)', I was expecting the memory >>> to rize up to 39 668, not to 52 760... Where does the difference come from? >>> >> What do you mean by "memory used" - i.e. where do you get that from? After >> GC? >> This certainly doesn't look like a "big dataset" by the numbers - I would >> classify that as tiny :) >> >> Cheers, >> Simon >> >> >>> Thanks >>> Christophe >>> >>> >>> -- >>> Christophe Genolini >>> Maître de conférences en bio-statistique >>> Vice président Communication interne et animation du campus >>> Université Paris Ouest Nanterre La Défense >>> >>> __ >>> R-devel@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-devel >>> >>> >> > > > -- > Christophe Genolini > Maître de conférences en bio-statistique > Vice président Communication interne et animation du campus > Université Paris Ouest Nanterre La Défense > > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] LazyData: no / yes
My real point was to explore the LazyData mechanism. So I try with LazyData: no and with LazyData: yes to see the difference, to see if I understand correctly the "WRE". The difference of the memory allocation pointed by the task manager alarm me, but you are right (I read the FAQ 7.42): my question has no real meaning. Thanks for pointing me the 7.42. Christophe On Nov 6, 2012, at 5:13 PM, Christophe Genolini wrote: I get it from windows tack manager (under Window 7). I guess it is in K something. My point was not about "how big is my dataset" (anyway, it is a fake dataset, so it can be as big as I want) but more about "where on hell are lost the 52 760 - 39 668 K ?" :-) Ask your system ;) - you're comparing wrong things: a) you didn't run garbage collection so there will be temporary objects around and b) see FAQ 7.42 why what you're looking at has no real meaning. Cheers, Simon Christophe On Nov 6, 2012, at 1:03 PM, Christophe Genolini wrote: Hi the list I have package foo0 with a big dataset 'myData'. In DESCRIPTION, if I use 'LazyData: no', then I get: - when I open a R session : memory used=20 908 - when I attach 'library(foo0)' : memory used=24364 - then I load the set 'data(myData)' : memory used=39 668 If I use LazyData: yes', then I get - when I open a R session : memory used=20 908 - when I attach 'library(foo0)' : memory used=52 760. In this second example, after 'library(foo0)', I was expecting the memory to rize up to 39 668, not to 52 760... Where does the difference come from? What do you mean by "memory used" - i.e. where do you get that from? After GC? This certainly doesn't look like a "big dataset" by the numbers - I would classify that as tiny :) Cheers, Simon Thanks Christophe -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du campus Université Paris Ouest Nanterre La Défense __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du campus Université Paris Ouest Nanterre La Défense -- Christophe Genolini Maître de conférences en bio-statistique Vice président Communication interne et animation du campus Université Paris Ouest Nanterre La Défense __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Strange behaviour in as.Date
I have been having trouble passing a default argument to base::as.Date.character and think it is due to some funkiness in the function definition. base::as.Date.character is defined as function (x, format = "", ...) { # stuff deleted res <- if (missing(format)) charToDate(x) else strptime(x, format, tz = "GMT") as.Date(res) } which gives unexpected behaviour when passing a default value of "" for format. I think the check "if(missing(format))" should really be "if(format=="")". Defining the wrapper: as.Date.character <- function(x, format='', ...) { if(format=='') base::as.Date.character(x, ...) else base::as.Date.character(x, format=format, ...) } provides (what I think is) the expected behaviour. ... is this the right list for this post? Cheers, Simon Knapp [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel