[Rd] What is pairlist in R-ints.pdf?
R-ints.pdf mentions pairlist with the reference to mit-scheme. However, it is not clear to me what 'pairlist' exactly refers to, as I don't find the definition for it. Does a 'pairlist' in R equivalent to a pair or a list (which is essentially a pair whose cdr is a list) in mit-scheme? __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] How S3method() is implemented and called? And when to use it?
R-exts.pdf discribes S3method a little bit. But I want to understand more on how it is called, implemented and when to use it. I don't find it in an R session. But I see S3method() in some NAMESPACE files. > S3method Error: object 'S3method' not found > ?S3method No documentation for 'S3method' in specified packages and libraries: you could try '??S3method' I don't understand why S3method is necessary. My understanding is that we can always use print.foo(} # and appropriate exporting to replace S3method(print, foo) , right? Or I misunderstand something? __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] long integer in R?
> a) restriction of representable integers. Today's platforms use 32-bit > integers, but on 16-bit platforms is used to be 16-bit hence the "almost". Just to make sure if I understand you correctly. So there are no 64-bit intergers on any platform? __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] long integer in R?
On Fri, Feb 12, 2010 at 12:06 PM, Simon Urbanek wrote: > > On Feb 12, 2010, at 12:33 , blue sky wrote: > >> R-exts.pdf dosen't list many types that are supported in C++, for example, >> long. Are there storage.mode corresponds to those extra types? >> > > There are none - that's why they are not listed. As for long: on 32-bit > platforms (and Win64) int and long are equivalent so you can simply use > INTSXP. On 64-bit unix platforms (LP64) there is no way to losslessly use it > (other than raw) but in most applications you can simply use REALSXP as it > gives you at least 52-bits of precision which its sufficient for most > applications. According to ?integer, "Note that on *almost* all implementations of R the range of representable integers is restricted to about +/-2*10^9: ‘double’s can hold much larger integers exactly." It uses 'almost'. I'm wondering on what platform integer is not restricted to about +/-2*10^9 so that double's can not hold large integers exactly? __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] long integer in R?
R-exts.pdf dosen't list many types that are supported in C++, for example, long. Are there storage.mode corresponds to those extra types? __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] filenames with special characters in the R/ directory of a package?
It is strange to me why the filename must start with a letter or digit, while the following characters can be something like '['. Is there a reason why it is designed in this way? So that I can understand the design principle rather than memorizing the facts derived from the principle. On Fri, Feb 12, 2010 at 5:10 AM, Prof Brian Ripley wrote: > 'Writing R Extensions' does say what names are allowed in the R directory > (at the start of section 1.1.3 in section-numbered formats). To wit > > The R subdirectory contains R code files, only. The code files to be > installed must start with an ASCII (lower or upper case) letter or > digit and have one of the extensions .R, .S, .q, .r, or .s. > > '[.set.R' does not meet that rule, and so is skipped. This is not something > R CMD check reports, since the wording implies that other names can be used > for files to be not installed. > > > On Fri, 12 Feb 2010, Barry Rowlingson wrote: > >> On Fri, Feb 12, 2010 at 5:35 AM, blue sky wrote: >>> >>> According to R-exts.pdf (page 3): >>> For maximal portability filenames should only >>> contain only ASCII characters not excluded already (that is >>> A-Za-z0-9._!#$%&+,;=...@^(){}’[] >>> >>> I have some files with special characters like '[' and '%' e.g. >>> '[.set.R'. >> >> That character list in your extract from R-exts.pdf is a list of >> non-special characters. And [ and % are in there. >> >> It's clarification of three sentences previous, which says: >> >> "the characters ‘"’, ‘*’, ‘:’, ‘/’, ‘<’, ‘>’, ‘?’, ‘\’, and ‘|’ are >> not allowed in file names" >> >>> I also have some functions that also have those special >>> characters defined in those files exported in NAMESPACE. >>> >>> I use the following command to install. And I get no warning or errors. >>> >>> R CMD INSTALL -d -l my_custom_dir my.pkg >>> >>> I then load the package. I get the following errors and warnings. I >>> changed a file to one without these special characters. Then the >>> corresponding warning/error disappears. Is it the case that there >>> should never be files with special characters as names? >>> >>>> library(my.pkg) >>> >>> Error in namespaceExport(ns, exports) : >>> undefined exports: %is% >>> In addition: Warning message: >>> S3 methods ‘[.set’ were declared in NAMESPACE but not found >>> Error: package/namespace load failed for 'my.pkg' >> >> Have you done an R CMD check on your package? I suspect a problem in >> your NAMESPACE file, but it's not related to "special characters". >> >> Barry >> >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> > > -- > Brian D. Ripley, rip...@stats.ox.ac.uk > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (PA) > Oxford OX1 3TG, UK Fax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] filenames with special characters in the R/ directory of a package?
According to R-exts.pdf (page 3): For maximal portability filenames should only contain only ASCII characters not excluded already (that is A-Za-z0-9._!#$%&+,;=...@^(){}’[] I have some files with special characters like '[' and '%' e.g. '[.set.R'. I also have some functions that also have those special characters defined in those files exported in NAMESPACE. I use the following command to install. And I get no warning or errors. R CMD INSTALL -d -l my_custom_dir my.pkg I then load the package. I get the following errors and warnings. I changed a file to one without these special characters. Then the corresponding warning/error disappears. Is it the case that there should never be files with special characters as names? > library(my.pkg) Error in namespaceExport(ns, exports) : undefined exports: %is% In addition: Warning message: S3 methods ‘[.set’ were declared in NAMESPACE but not found Error: package/namespace load failed for 'my.pkg' __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel