[Rd] Most accurate timing?
For a graphics display, I'd like a high resolution timer, something like Sys.time(), but it is only accurate to a second. Is there a clock in R that gives a finer value? Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Most accurate timing?
> "Duncan" == Duncan Murdoch <[EMAIL PROTECTED]> > on Mon, 01 Aug 2005 08:48:39 -0400 writes: Duncan> For a graphics display, I'd like a high resolution Duncan> timer, something like Sys.time(), but it is only Duncan> accurate to a second. Is there a clock in R that Duncan> gives a finer value? Why can't use proc.time() ? It's help file says The resolution of the times will be system-specific; it is common for them to be recorded to of the order of 1/100 second, and elapsed time is rounded to the nearest 1/100. Martin Maechler __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Most accurate timing?
On 8/1/2005 9:09 AM, Martin Maechler wrote: >> "Duncan" == Duncan Murdoch <[EMAIL PROTECTED]> >> on Mon, 01 Aug 2005 08:48:39 -0400 writes: > > Duncan> For a graphics display, I'd like a high resolution > Duncan> timer, something like Sys.time(), but it is only > Duncan> accurate to a second. Is there a clock in R that > Duncan> gives a finer value? > > Why can't use proc.time() ? > > It's help file says > > The resolution of the times will be system-specific; it is > common for them to be recorded to of the order of 1/100 > second, and elapsed time is rounded to the nearest 1/100. > proc.time()[3] is what I want; I had forgotten about it. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Testing for English locale
Dear r-devel list members, Is there a platform-independent way to test whether R is running in an English locale? Thanks, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Testing for English locale
On Aug 1, 2005, at 10:20 AM, John Fox wrote: > Is there a platform-independent way to test whether R is running in > an English locale? I suppose the following should work: Sys.getlocale("LC_CTYPE")=="C" || length(grep("^en",Sys.getlocale ("LC_CTYPE"),TRUE))>0 Basically unix platforms will have "C" or "en_..."; Windows has "English...". You could make the check more strict depending on the platform if desired .. Cheers, Simon __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Follow-Up: R on FC4
Dear List, A few weeks ago a discussion took place regarding Fedora Core 4 and compiling R on that platform using the new version 4 of gcc and its gfortran compiler. gcc was recently updated to 4.0.1 on FC4 (4.0.1-5 in Red Hat Land) so I thought I'd give compiling R a go on my laptop which needed updating anyway. I've had trouble using the optimisation flags I used to use under FC3 with FC4 and the compatibility version of g77, so I wanted to see if I could compile with the flags I was used to (under FC3) with gfortran on FC4. I was compiling with no extra flags on g77 to get it to compile at all on my FC4 desktop. R-patched compiles and make check-all succeeds on FC with gcc/g+ +/gfortran using these options at least: -g -O3 -m32 -pipe -mcpu=i386 - mtune=pentium3m R-devel compiles without error (same set of flags as above) but fails make check-all in p-r-random-tests.R - the relevant section of p-r- random-tests.Rout.fail is: ... > dkwtest("norm") norm() PASSED [1] TRUE > dkwtest("norm",mean = 5,sd = 3) norm(mean = 5, sd = 3) PASSED [1] TRUE > > dkwtest("gamma",shape = 0.1) gamma(shape = 0.1) PASSED [1] TRUE > dkwtest("gamma",shape = 0.2) gamma(shape = 0.2) PASSED [1] TRUE > dkwtest("gamma",shape = 10) gamma(shape = 10) FAILED Error in dkwtest("gamma", shape = 10) : dkwtest failed Execution halted Is this a tolerance setting in R's tests not being met or is this indicative of a bad compilation of R-Devel on FC4 with gfortran? Both these compilations was using the svn-acquired sources from this afternoon: R-patched = revision 35098 R-Devel = revision 35098 HTH G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [T] +44 (0)20 7679 5522 ENSIS Research Fellow [F] +44 (0)20 7679 7565 ENSIS Ltd. & ECRC [E] gavin.simpsonATNOSPAMucl.ac.uk UCL Department of Geography [W] http://www.ucl.ac.uk/~ucfagls/cv/ 26 Bedford Way[W] http://www.ucl.ac.uk/~ucfagls/ London. WC1H 0AP. %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] fifo on Windows
Are there any plans to support fifo on Windows? On my XP system ("R version 2.1.1, 2005-06-23") R> capabilities("fifo") gives FALSE. Note that Windows does support named pipes as shown in the utility: http://gearbox.maem.umr.edu/fwu/pipeslot.zip __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Follow-Up: R on FC4
On Mon, 1 Aug 2005, Gavin Simpson wrote: > R-devel compiles without error (same set of flags as above) but fails > make check-all in p-r-random-tests.R - the relevant section of p-r- > random-tests.Rout.fail is: > > ... >> dkwtest("norm") > norm() PASSED > [1] TRUE >> dkwtest("norm",mean = 5,sd = 3) > norm(mean = 5, sd = 3) PASSED > [1] TRUE >> >> dkwtest("gamma",shape = 0.1) > gamma(shape = 0.1) PASSED > [1] TRUE >> dkwtest("gamma",shape = 0.2) > gamma(shape = 0.2) PASSED > [1] TRUE >> dkwtest("gamma",shape = 10) > gamma(shape = 10) FAILED > Error in dkwtest("gamma", shape = 10) : dkwtest failed > Execution halted > > Is this a tolerance setting in R's tests not being met or is this > indicative of a bad compilation of R-Devel on FC4 with gfortran? > Try this again -- it is a random test. If it fails again then something is wrong. The tolerance on these tests is not very tight, certainly nowhere near rounding error. -thomas __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Follow-Up: R on FC4
On Mon, 2005-08-01 at 10:16 -0700, Thomas Lumley wrote: > On Mon, 1 Aug 2005, Gavin Simpson wrote: > > R-devel compiles without error (same set of flags as above) but fails > > make check-all in p-r-random-tests.R - the relevant section of p-r- > > random-tests.Rout.fail is: > > > > ... > >> dkwtest("norm") > > norm() PASSED > > [1] TRUE > >> dkwtest("norm",mean = 5,sd = 3) > > norm(mean = 5, sd = 3) PASSED > > [1] TRUE > >> > >> dkwtest("gamma",shape = 0.1) > > gamma(shape = 0.1) PASSED > > [1] TRUE > >> dkwtest("gamma",shape = 0.2) > > gamma(shape = 0.2) PASSED > > [1] TRUE > >> dkwtest("gamma",shape = 10) > > gamma(shape = 10) FAILED > > Error in dkwtest("gamma", shape = 10) : dkwtest failed > > Execution halted > > > > Is this a tolerance setting in R's tests not being met or is this > > indicative of a bad compilation of R-Devel on FC4 with gfortran? > > > > Try this again -- it is a random test. If it fails again then something > is wrong. The tolerance on these tests is not very tight, certainly > nowhere near rounding error. Thanks Thomas, A re-compile with the same options of R-Devel went through without error. So far so good with FC4, gcc4, gfortran and R! All the best, G > > -thomas -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [T] +44 (0)20 7679 5522 ENSIS Research Fellow [F] +44 (0)20 7679 7565 ENSIS Ltd. & ECRC [E] gavin.simpsonATNOSPAMucl.ac.uk UCL Department of Geography [W] http://www.ucl.ac.uk/~ucfagls/cv/ 26 Bedford Way[W] http://www.ucl.ac.uk/~ucfagls/ London. WC1H 0AP. %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] fifo on Windows
Gabor Grothendieck wrote: > Are there any plans to support fifo on Windows? On my XP > system ("R version 2.1.1, 2005-06-23") > >R> capabilities("fifo") > > gives FALSE. > > Note that Windows does support named pipes as shown > in the utility: > >http://gearbox.maem.umr.edu/fwu/pipeslot.zip I think named pipes are only supported on the NT descendants. We will need to drop support for Win9x soon, but I think we still have a number of users using Win98 and maybe WinME. I guess we could add support for features that only work on some Windows platforms, but I'd rather not do that until we're not officially saying that R runs on Win9x. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Follow-Up: R on FC4
Gavin Simpson <[EMAIL PROTECTED]> writes: > > Try this again -- it is a random test. If it fails again then something > > is wrong. The tolerance on these tests is not very tight, certainly > > nowhere near rounding error. > > Thanks Thomas, > > A re-compile with the same options of R-Devel went through without > error. > > So far so good with FC4, gcc4, gfortran and R! The problem affecting the Fedora Extras RPM is still there with the new compilers though: -Wp,-D_FORTIFY_SOURCE=2 combined with -O or -O2 causes a strange printing bug: > matrix(list(pi)) [,1] [1,] (You don't have to use that option of course, but it suggests that not all is well with the optimizer. And the Fedora maintainer seem set on using it, which is a bit of a problem.) -- O__ Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] fifo on Windows
fifo already works on UNIX, I assume, so it seems its already the situation that fifos are supported on some machines running R but not on others. If they were supported on those Windows platforms that can handle them then that would simply increase the proportion of machines running R that can handle them (thinking in terms of across all machines running R rather than thinking in terms of across all machines running R and Windows). Note that one does have the capabilities command in any case so the code could query that at the beginning and give an error if its FALSE so no change to the code would be required in the future since it would never run in that situation anyways. On 8/1/05, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > Gabor Grothendieck wrote: > > Are there any plans to support fifo on Windows? On my XP > > system ("R version 2.1.1, 2005-06-23") > > > >R> capabilities("fifo") > > > > gives FALSE. > > > > Note that Windows does support named pipes as shown > > in the utility: > > > >http://gearbox.maem.umr.edu/fwu/pipeslot.zip > > I think named pipes are only supported on the NT descendants. We will > need to drop support for Win9x soon, but I think we still have a number > of users using Win98 and maybe WinME. > > I guess we could add support for features that only work on some Windows > platforms, but I'd rather not do that until we're not officially saying > that R runs on Win9x. > > Duncan Murdoch > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] valgrind complains about regex.c (PR#8043)
I think I am using objects according to the man page. This seems to be a valid regular expression. But whether I know what I'm doing or no, it still shouldn't be doing what valgrind seems to be saying it's doing. (IMHO) -- start of script -- Script started on Mon 01 Aug 2005 02:09:00 PM PDT linux$ printenv VALGRIND_OPTS --tool=3Dmemcheck linux$ cat bar.R foo <- 1 bar <- 2:3 baz <- 4:6 qux <- matrix(7:10, 2) ls() rm(list =3D objects(pattern =3D "^[a-pr-z]")) ls() linux$ R --version R 2.1.1 (2005-06-20). Copyright (C) 2005 R Development Core Team R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under the terms of the GNU General Public License. For more information about these matters, see http://www.gnu.org/copyleft/gpl.html. linux$ gcc --version =1B[0mgcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux) =1B[0mCopyright (C) 2003 Free Software Foundation, Inc. =1B[0mThis is free software; see the source for copying conditions. There = is NO =1B[0mwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PU= RPOSE. =1B[0m linux$ cat /etc/SuSE-release=20 SuSE Linux 9.3 (i586) VERSION =3D 9.3 linux$ R --vanilla --debugger=3Dvalgrind < bar.R >| bar.Rout =3D=3D22324=3D=3D Memcheck, a memory error detector for x86-linux. =3D=3D22324=3D=3D Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward = et al. =3D=3D22324=3D=3D Using valgrind-2.2.0, a program supervision framework for= x86-linux. =3D=3D22324=3D=3D Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward = et al. =3D=3D22324=3D=3D For more details, rerun with: -v =3D=3D22324=3D=3D=20 =3D=3D22324=3D=3D Invalid read of size 4 =3D=3D22324=3D=3Dat 0x81255AD: parse_expression (regex.c:5045) =3D=3D22324=3D=3Dby 0x8125868: parse_branch (regex.c:4475) =3D=3D22324=3D=3Dby 0x8125913: parse_reg_exp (regex.c:4420) =3D=3D22324=3D=3Dby 0x81261B3: Rf_regcomp (regex.c:4384) =3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 a= lloc'd =3D=3D22324=3D=3Dat 0x1B90650D: calloc (in /usr/lib/valgrind/vgpreload_= memcheck.so) =3D=3D22324=3D=3Dby 0x81247B5: parse_expression (regex.c:5406) =3D=3D22324=3D=3Dby 0x8125868: parse_branch (regex.c:4475) =3D=3D22324=3D=3Dby 0x8125913: parse_reg_exp (regex.c:4420) =3D=3D22324=3D=3D=20 =3D=3D22324=3D=3D Invalid write of size 4 =3D=3D22324=3D=3Dat 0x81255B2: parse_expression (regex.c:5045) =3D=3D22324=3D=3Dby 0x8125868: parse_branch (regex.c:4475) =3D=3D22324=3D=3Dby 0x8125913: parse_reg_exp (regex.c:4420) =3D=3D22324=3D=3Dby 0x81261B3: Rf_regcomp (regex.c:4384) =3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 a= lloc'd =3D=3D22324=3D=3Dat 0x1B90650D: calloc (in /usr/lib/valgrind/vgpreload_= memcheck.so) =3D=3D22324=3D=3Dby 0x81247B5: parse_expression (regex.c:5406) =3D=3D22324=3D=3Dby 0x8125868: parse_branch (regex.c:4475) =3D=3D22324=3D=3Dby 0x8125913: parse_reg_exp (regex.c:4420) =3D=3D22324=3D=3D=20 =3D=3D22324=3D=3D ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 39 f= rom 2) =3D=3D22324=3D=3D malloc/free: in use at exit: 12691882 bytes in 6426 block= s. =3D=3D22324=3D=3D malloc/free: 32534 allocs, 26108 frees, 33105500 bytes al= located. =3D=3D22324=3D=3D For a detailed leak analysis, rerun with: --leak-check= =3Dyes =3D=3D22324=3D=3D For counts of detected errors, rerun with: -v linux$ exit Script done on Mon 01 Aug 2005 02:10:42 PM PDT -- end of script -- --=20 Charles Geyer Professor, School of Statistics University of Minnesota [EMAIL PROTECTED] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] valgrind complains about regex.c (PR#8043)
Did you compile R without optimization? Such reads are often the result of read-aheads produced by the optimizer in an attempt to keep pipelines full (and are harmless). On an un-optimized build of R I am unable to reproduce this. (I also was unable to reproduce it on my optimized build of 2.1.1 using gcc 3.4.4, although I did get a report on other read-aheads.) On Mon, 1 Aug 2005 [EMAIL PROTECTED] wrote: > I think I am using objects according to the man page. > This seems to be a valid regular expression. But whether > I know what I'm doing or no, it still shouldn't be doing > what valgrind seems to be saying it's doing. (IMHO) I think you need to take that up with compiler designers: it is common practice. > -- start of script -- > Script started on Mon 01 Aug 2005 02:09:00 PM PDT > linux$ printenv VALGRIND_OPTS > --tool=3Dmemcheck > linux$ cat bar.R > > foo <- 1 > bar <- 2:3 > baz <- 4:6 > qux <- matrix(7:10, 2) > > ls() > rm(list =3D objects(pattern =3D "^[a-pr-z]")) > ls() > > linux$ R --version > R 2.1.1 (2005-06-20). > Copyright (C) 2005 R Development Core Team > > R is free software and comes with ABSOLUTELY NO WARRANTY. > You are welcome to redistribute it under the terms of the GNU > General Public License. For more information about these matters, > see http://www.gnu.org/copyleft/gpl.html. > linux$ gcc --version > =1B[0mgcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux) > =1B[0mCopyright (C) 2003 Free Software Foundation, Inc. > =1B[0mThis is free software; see the source for copying conditions. There = > is NO > =1B[0mwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PU= > RPOSE. > =1B[0m > linux$ cat /etc/SuSE-release=20 > SuSE Linux 9.3 (i586) > VERSION =3D 9.3 > linux$ R --vanilla --debugger=3Dvalgrind < bar.R >| bar.Rout > =3D=3D22324=3D=3D Memcheck, a memory error detector for x86-linux. > =3D=3D22324=3D=3D Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward = > et al. > =3D=3D22324=3D=3D Using valgrind-2.2.0, a program supervision framework for= > x86-linux. > =3D=3D22324=3D=3D Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward = > et al. > =3D=3D22324=3D=3D For more details, rerun with: -v > =3D=3D22324=3D=3D=20 > =3D=3D22324=3D=3D Invalid read of size 4 > =3D=3D22324=3D=3Dat 0x81255AD: parse_expression (regex.c:5045) > =3D=3D22324=3D=3Dby 0x8125868: parse_branch (regex.c:4475) > =3D=3D22324=3D=3Dby 0x8125913: parse_reg_exp (regex.c:4420) > =3D=3D22324=3D=3Dby 0x81261B3: Rf_regcomp (regex.c:4384) > =3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 a= > lloc'd > =3D=3D22324=3D=3Dat 0x1B90650D: calloc (in /usr/lib/valgrind/vgpreload_= > memcheck.so) > =3D=3D22324=3D=3Dby 0x81247B5: parse_expression (regex.c:5406) > =3D=3D22324=3D=3Dby 0x8125868: parse_branch (regex.c:4475) > =3D=3D22324=3D=3Dby 0x8125913: parse_reg_exp (regex.c:4420) > =3D=3D22324=3D=3D=20 > =3D=3D22324=3D=3D Invalid write of size 4 > =3D=3D22324=3D=3Dat 0x81255B2: parse_expression (regex.c:5045) > =3D=3D22324=3D=3Dby 0x8125868: parse_branch (regex.c:4475) > =3D=3D22324=3D=3Dby 0x8125913: parse_reg_exp (regex.c:4420) > =3D=3D22324=3D=3Dby 0x81261B3: Rf_regcomp (regex.c:4384) > =3D=3D22324=3D=3D Address 0x1C1E23A8 is 0 bytes after a block of size 32 a= > lloc'd > =3D=3D22324=3D=3Dat 0x1B90650D: calloc (in /usr/lib/valgrind/vgpreload_= > memcheck.so) > =3D=3D22324=3D=3Dby 0x81247B5: parse_expression (regex.c:5406) > =3D=3D22324=3D=3Dby 0x8125868: parse_branch (regex.c:4475) > =3D=3D22324=3D=3Dby 0x8125913: parse_reg_exp (regex.c:4420) > =3D=3D22324=3D=3D=20 > =3D=3D22324=3D=3D ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 39 f= > rom 2) > =3D=3D22324=3D=3D malloc/free: in use at exit: 12691882 bytes in 6426 block= > s. > =3D=3D22324=3D=3D malloc/free: 32534 allocs, 26108 frees, 33105500 bytes al= > located. > =3D=3D22324=3D=3D For a detailed leak analysis, rerun with: --leak-check= > =3Dyes > =3D=3D22324=3D=3D For counts of detected errors, rerun with: -v > linux$ exit > > Script done on Mon 01 Aug 2005 02:10:42 PM PDT > -- end of script -- > --=20 > Charles Geyer > Professor, School of Statistics > University of Minnesota > [EMAIL PROTECTED] > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > > -- Brian D. Ripley, [EMAIL PROTECTED] 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