Re: [Rd] readCitationFile encoding
On Thu, 31 Dec 2009, Jens Elkner wrote: Hi, does anybody know, how to enforce a certain encoding for readCitationFile()? Haven't found any usable documentation for this :( Really? From the help file in current versions of R (2.10.1 patched, R-devel) ‘readCitationFile’ make use of the ‘encoding’ element (if any) of ‘meta’ to determine the encoding of the file. so readCitationFile(basecit, list(encoding="latin1")) is probably what you are looking for. And PLEASE do use the recommended portable encoding names. E.g.: basecit <- system.file("CITATION", package="base") source(basecit, echo=TRUE, encoding="8859-1") readCitationFile(basecit) BTW: 'make check' is a relativ long running task and if one changes a source file, all checks are ran again til it gets to the code in question (in my case tests/Examples/utils-Ex.Rout.fail). Is there a shortcut to jump immediately to the utils tests? No, but many sections can be suppressed -- see check --help and the environment variables discussed in the R Internals manual. Regards, jel. -- Otto-von-Guericke University http://www.cs.uni-magdeburg.de/ Department of Computer Science Geb. 29 R 027, Universitaetsplatz 2 39106 Magdeburg, Germany Tel: +49 391 67 12768 __ 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, UKFax: +44 1865 272595__ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] seq.int broken (seq as well) (PR#14169)
On Mon, Dec 28, 2009 at 08:50:13PM +0100, oehl_l...@gmx.de wrote: [...] > # fine as expected from help page: > # "from+by, ..., up to the sequence value less than or equal to to" > # thus 1+10=11 is not in > > seq.int(1L, 10L, by=10L) > [1] 1 > > # of course 1+1e7 should also not be in > # but is: wrong > > seq.int(1L, 1e7L, by=1e7L) > [1] 1e+00 1e+07 > > # since we use seq.int AND are within integer range, rounding should not be an > issue In my opinion, this is a documented behavior. The Details section of the help page says Note that the computed final value can go just beyond 'to' to allow for rounding error, but (as from R 2.9.0) is truncated to 'to'. Since "by" is 1e7, going by 1 more than 'to' is "just beyond 'to'". What can be a bit misleading is the following difference between the type of seq() and seq.int(), which is only partially documented. x <- seq.int(from=1L, to=1000L, by=1000L); typeof(x); x # [1] "double" # [1] 1e+00 1e+07 x <- seq(from=1L, to=1000L, by=1000L); typeof(x); x # [1] "integer" # [1]1 1000 The Value section of the help page says: Currently, 'seq.int' and the default method of 'seq' return a result of type '"integer"' (if it is representable as that and) if 'from' is (numerically equal to an) integer and, e.g., only 'to' is specified, or also if only 'length' or only 'along.with' is specified. *Note:* this may change in the future and programmers should not rely on it. This suggests that we should get "double" in both cases, since all three arguments "from", "to", and "by" are specified. I do not know, whether having an "integer" result in seq() in the above case is intended or not. Petr Savicky. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] creating R package-perl
On 30.12.2009 19:04, karina lopez wrote: do "R CMD install mypkg" an error appears : "Can't open perl script "C:\PROGRA~1\R\R-210~1.0/bin/install": No such file or di rectory", but i installed perl in C:\Rtools\perl\bin and i wrote it in the path, i need to do something more??? Yes, it's case sensitive here, hence you need to do something more: use the shift key and type R CMD INSTALL mypkg Uwe Ligges __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Bug query (PR#14173)
This is R-bugs. Please read the FAQs about bugs in R and learn not to post non base R bugs to R-bugs. On 30.12.2009 19:15, edward.grac...@drexelmed.edu wrote: I'm seeing a probable error in the way R boot.ci calculates certain confidence intervals. Not sure where to submit it. Should this go to the package maintainer? Yes, if it is a bug which we cannot confirm given the missing of all relevant information. If so, how would I identify that person? library(help = "boot") or more explicitly: packageDescription("boot")$Maintainer Uwe Ligges =20 Thanks...Ed =20 Ed J. Gracely, Ph.D. Drexel University College of Medicine& Drexel University School of Public Health Mail to: Family, Community, and Preventive Medicine Drexel University College of Medicine 2900 Queen Lane Philadelphia PA, 19129 215-991-8466 phone 215-843-6028 fax egrac...@drexelmed.edu =20 [[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] configure R-2.10.1 => "Error: MPlayer will not compile without (PR#14175)
Hi. uname -a Linux localhost.localdomain 2.6.30.10-105.fc11.i686.PAE #1 SMP Thu Dec 24 16:41:17 UTC 2009 i686 i686 i386 GNU/Linux [...@localhost R-2.10.1]$ pwd /home/??/Bin/RStats/R-2.10.1 I fixed this before for previous version of R by copying part of the mplayer tree into the R tree. But, I forgot what I did. Any help? Checking for FFmpeg libavutil ... Error: MPlayer will not compile without libavutil in the source tree. Check "configure.log" if you do not understand why it failed. [mlut...@localhost R-2.10.1]$ tail -f configure.log cc1plus: warning: command line option "-std=gnu99" is valid for C/ObjC but not for C++ /tmp/mplayer-conf-24144-9141.cpp:1:24: error: liveMedia.hh: No such file or directory /tmp/mplayer-conf-24144-9141.cpp:2:6: warning: "LIVEMEDIA_LIBRARY_VERSION_INT" is not defined /tmp/mplayer-conf-24144-9141.cpp:3:2: error: #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from Result is: no ## Checking for FFmpeg libavutil I added everything I could with "Add/Remove Sofware" for mpeg. There is no mplayer in "Add/Remove Sofware". [mlut...@localhost R-2.10.1]$ uname -a Linux localhost.localdomain 2.6.30.10-105.fc11.i686.PAE #1 SMP Thu Dec 24 16:41:17 UTC 2009 i686 i686 i386 GNU/Linux [mlut...@localhost R-2.10.1]$ configure sed: can't read libavcodec/allcodecs.c: No such file or directory sed: can't read libavcodec/allcodecs.c: No such file or directory sed: can't read libavcodec/allcodecs.c: No such file or directory sed: can't read libavcodec/allcodecs.c: No such file or directory sed: can't read libavformat/allformats.c: No such file or directory sed: can't read libavformat/allformats.c: No such file or directory sed: can't read libavformat/allformats.c: No such file or directory Detected operating system: Linux Detected host architecture: i386 Checking for cc version ... 4.4.1 Checking for host cc ... cc Checking for cross compilation ... no Checking for CPU vendor ... GenuineIntel (15:2:4) Checking for CPU type ... Intel(R) Pentium(R) 4 CPU 2.00GHz Checking for kernel support of mmx ... yes Checking for kernel support of mmxext ... yes Checking for kernel support of sse ... yes Checking for kernel support of sse2 ... yes Checking for kernel support of cmov ... yes Checking for mtrr support ... yes Checking for GCC & CPU optimization abilities ... native Checking for byte order ... little-endian Checking for extern symbol prefix ... Checking for assembler support of -pipe option ... yes Checking for compiler support of named assembler arguments ... yes Checking for assembler (as 2.19.51.0.14) ... ok Checking for .align is a power of two ... no Checking for 10 assembler operands ... yes Checking for ebx availability ... yes Checking for yasm ... no Checking for bswap ... yes Checking for Linux kernel version ... 2.6.30.10-105.fc11.i686.PAE, ok Checking for -lposix ... no Checking for -lm ... yes Checking for langinfo ... yes Checking for language ... messages: en - man pages: en - documentation: en Checking for enable sighandler ... yes Checking for runtime cpudetection ... no Checking for restrict keyword ... restrict Checking for __builtin_expect ... yes Checking for kstat ... no Checking for posix4 ... no Checking for llrint ... yes Checking for log2 ... yes Checking for lrint ... yes Checking for lrintf ... yes Checking for round ... yes Checking for roundf ... yes Checking for truncf ... yes Checking for mkstemp ... yes Checking for nanosleep ... yes Checking for socklib ... yes Checking for arpa/inet.h ... yes Checking for inet_pton() ... yes Checking for inet_aton() ... yes Checking for socklen_t ... yes Checking for closesocket() ... no Checking for network ... yes Checking for inet6 ... yes Checking for gethostbyname2 ... yes Checking for inttypes.h (required) ... yes Checking for int_fastXY_t in inttypes.h ... yes Checking for malloc.h ... yes Checking for memalign() ... yes Checking for posix_memalign() ... yes Checking for alloca.h ... yes Checking for fastmemcpy ... yes Checking for mman.h ... yes Checking for dynamic loader ... yes Checking for dynamic a/v plugins support ... no Checking for pthread ... yes (using -lpthread) Checking for w32threads ... no (using pthread instead) Checking for rpath ... no Checking for iconv ... yes Checking for soundcard.h ... yes (sys/soundcard.h) Checking for sys/dvdio.h ... no Checking for sys/cdio.h ... no Checking for linux/cdrom.h ... yes Checking for dvd.h ... no Checking for termcap ... yes (using -lncurses) Checking for termios ... yes (using sys/termios.h) Checking for shm ... yes Checking for strsep() ... yes Checking for vsscanf() ... yes Checking for swab() ... yes Checking for POSIX select() ... yes Checking for audio select() ... yes Checking for gettimeofday() ... yes Checking for glob() ... yes Checking for set
Re: [Rd] readCitationFile encoding
On Thu, Dec 31, 2009 at 08:01:15AM +, Prof Brian Ripley wrote: > On Thu, 31 Dec 2009, Jens Elkner wrote: Hi, > >does anybody know, how to enforce a certain encoding for > >readCitationFile()? Haven't found any usable documentation for this :( > > Really? Yes. Well, just started to dive into R and that's probably the problem (like in old UNIX times), the help aka man pages are very useful and sufficient, if you know the language/system ... ;-) > From the help file in current versions of R (2.10.1 patched, > R-devel) > > ¡readCitationFile¢ make use of the ¡encoding¢ element (if any) of > ¡meta¢ to determine the encoding of the file. Ah - ok, haven't applied the latest release.diff. But anyway, for a newbie it is not easy to find out, what "meta" is expected to be. > so > readCitationFile(basecit, list(encoding="latin1")) Yepp - with a leading uppercase E it works. Thanx a lot!!! :) > is probably what you are looking for. And PLEASE do use the > recommended portable encoding names. OT: Wondering, what does "recommended portable encoding names" in this context mean (e.g. AFAIK 'latin1' is not a standardized name ...). BTW: Just build R-2.10.1 on Solaris Nevada b129 (x86_64) using its native iconv facilities in libc and sunperf libs (wrt. BLAS/LAPACK) only. It works now and all checks are saying, everything is ok. > >BTW: 'make check' is a relativ long running task and if one changes > >a source file, all checks are ran again til it gets to the code in > >question (in my case tests/Examples/utils-Ex.Rout.fail). Is there > >a shortcut to jump immediately to the utils tests? > > No, but many sections can be suppressed -- see check --help and the > environment variables discussed in the R Internals manual. Ahh - good hint - help("check") wasn't really fruitful. However, elkner.idev2 build/R-2.10.1/bin > ./check --help Can't locate File/Copy/Recursive.pm in @INC (@INC contains: ... So still need to do a little bit tweaking ... Anyway, thanx a lot for your quick help!!!, jel. -- Otto-von-Guericke University http://www.cs.uni-magdeburg.de/ Department of Computer Science Geb. 29 R 027, Universitaetsplatz 2 39106 Magdeburg, Germany Tel: +49 391 67 12768 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] readCitationFile encoding
On Dec 31, 2009, at 10:05 AM, Jens Elkner wrote: > On Thu, Dec 31, 2009 at 08:01:15AM +, Prof Brian Ripley wrote: >> On Thu, 31 Dec 2009, Jens Elkner wrote: > Hi, > >>> does anybody know, how to enforce a certain encoding for >>> readCitationFile()? Haven't found any usable documentation for this :( >> >> Really? > > Yes. Well, just started to dive into R and that's probably the problem > (like in old UNIX times), the help aka man pages are very useful and > sufficient, if you know the language/system ... ;-) > >> From the help file in current versions of R (2.10.1 patched, >> R-devel) >> >> ¡readCitationFile¢ make use of the ¡encoding¢ element (if any) of >> ¡meta¢ to determine the encoding of the file. > > Ah - ok, haven't applied the latest release.diff. But anyway, for a > newbie it is not easy to find out, what "meta" is expected to be. > >> so >> readCitationFile(basecit, list(encoding="latin1")) > > Yepp - with a leading uppercase E it works. Thanx a lot!!! :) > >> is probably what you are looking for. And PLEASE do use the >> recommended portable encoding names. > > OT: Wondering, what does "recommended portable encoding names" in this > context mean (e.g. AFAIK 'latin1' is not a standardized name ...). It is in R -- since no standard name for that encoding exists in general R maps "latin1" to whatever the OS expects this to be -- see ?Encoding. > BTW: Just build R-2.10.1 on Solaris Nevada b129 (x86_64) using its native > iconv facilities in libc and sunperf libs (wrt. BLAS/LAPACK) only. It > works now and all checks are saying, everything is ok. > >>> BTW: 'make check' is a relativ long running task and if one changes >>> a source file, all checks are ran again til it gets to the code in >>> question (in my case tests/Examples/utils-Ex.Rout.fail). Is there >>> a shortcut to jump immediately to the utils tests? >> >> No, but many sections can be suppressed -- see check --help and the >> environment variables discussed in the R Internals manual. > > Ahh - good hint - help("check") wasn't really fruitful. However, > > elkner.idev2 build/R-2.10.1/bin > ./check --help > Can't locate File/Copy/Recursive.pm in @INC (@INC contains: ... > > So still need to do a little bit tweaking ... > .. rather reading the docs ;). It's R CMD check --help (since we're on R-devel knowledge of basics is assumed). Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Benefit of treating NA and NaN differently for numerics
Hello, I notice in main/arithmetic.c, that NA and NaN are encoded differently(since every numeric NA comes from R_NaReal which is defined via ValueOfNA) . What is the benefit of treating these two differently? Why can't NA be a synonym for NaN? Thank you Saptarshi (R-2.9) __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Benefit of treating NA and NaN differently for numerics
On 31-Dec-09 20:43:43, Saptarshi Guha wrote: > Hello, > I notice in main/arithmetic.c, that NA and NaN are encoded > differently(since every numeric NA comes from R_NaReal which is > defined via ValueOfNA) > What is the benefit of treating these two differently? Why can't NA > be a synonym for NaN? > > Thank you > Saptarshi > (R-2.9) Because they are used to represent different things. Others will be able to give you a much more comprehensive account than I can of their uses in R, but essentially: NaN represents a result which is not valid (i.e. "Not a Number") in the domain of quantities being evaluated. For example, R does its arithmetic by default in the domain of "double", i.e. the machine representation of real numbers. In this domain, sqrt(-1) does not exist -- it is not a number in the domain of real numbers. Hence: sqrt(-1) # [1] NaN # Warning message: # In sqrt(-1) : NaNs produced In order to obtain a result which does exist, you need to switch domain to complex numbers: > sqrt(as.complex(-1)) # [1] 0+1i NA, on the other hand, represents a value (in whatever domain: double, logical, character, ...) which is not known, which is why it is typically used to represent missing data. It would be a valid entity in the current domain if its value were known, but the value is not known. Hence the result of any expression involving NA quantities is NA, since the value if the expression would depend on the unkown elements, and hence the value of the expression is unknown. This distinction is important and useful, so it should not be done away with by merging NaN and NA! Best wishes, Ted. E-Mail: (Ted Harding) Fax-to-email: +44 (0)870 094 0861 Date: 31-Dec-09 Time: 21:05:06 -- XFMail -- __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Benefit of treating NA and NaN differently for numerics
On 31/12/2009 3:43 PM, Saptarshi Guha wrote: Hello, I notice in main/arithmetic.c, that NA and NaN are encoded differently(since every numeric NA comes from R_NaReal which is defined via ValueOfNA) . What is the benefit of treating these two differently? Why can't NA be a synonym for NaN? I don't know of any cases where a useful distinction is made between NA and NaN, but I suppose it could be useful to know where the bad value came from. R functions rarely generate NaN directly, it usually comes from the hardware or runtime library. And by the way, as the thread containing this message shows, http://finzi.psych.upenn.edu/R/R-devel/2009-August/054319.html there are several different encodings which are displayed as NA, and a huge number (more than 2^50, I seem to recall) of different encodings displayed as NaN. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] How x[, 'colname1'] is implemented?
I don't see where describes the implementation of '[]'. For example, if x is a matrix or a data.frame, how the lookup of 'colname1' is x[, 'colname1'] executed. Does R perform a lookup in the a hash of the colnames? Is the reference O(1) or O(n), where n is the second dim of x? __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel