Re: [Rd] Data frames and row names
On 8/14/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > On Mon, 14 Aug 2006, Henrik Bengtsson wrote: > > > In R-devel v2.4.0 NEWS: > > > > o The 'row.names' of a data frame may be stored internally as an > > integer or character vector. This can result in considerably > > more compact storage (and more logical row names from rbind) > > when the row.names are 1:nrow(x). However, such data frames > > are not compatible with earlier versions of R: this can be > > ensured by supplying a character vector as 'row.names'. > > > > This is great. > > > > With row.names == NULL for 1:nrow(x) the storage would be even more > > compact. > > A few bytes more compact. Some day you may get up to the next few lines > of NEWS which say > > The internal storage of row.names = 1:n just records 'n' for > efficiency with very long vectors. > > (BTW, this is four months' old news, hence my 'some day' comment.) What is a very long vector? I would really like to see this for short vectors too, because in my case I would have half a million data frames with 10-20 rows (microarray data) and that adds up to 30-70Mb of memory. Just curious if you just store 'n', how do you tell if the row.names == n or 1:n? Thanks. /H > > > > I noticed that the number of rows is inferred from row > > names: > > > > > dim.data.frame > > function (x) > > c(length(attr(x, "row.names")), length(x)) > > > > > > but couldn't the number of rows be inferred from the first column, if > > there are no row names? I realize that this would break the case with > > zero-column data frames, e.g. > > > > > df <- data.frame(a=1:10) > > > df[,-1] > > NULL data frame with 10 rows. > > > > ...but maybe there is a way around that too. > > Yes, see above. > > -- > 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
[Rd] MS installer version of R for Windows
We've had requests from time to time from sysadmins who want a MSI version of R. My sysadmins did recently, and David del Campo made one for R-2.3.0 using the WiX toolkit. I've now scripted this, and it is part of the R-devel and R-patched sources. Duncan Murdoch is on vacation, and I don't know if we will decide to distribute an MSI version. But in case anyone needs one before 2.4.0 is released, I've put up http://www.stats.ox.ac.uk/pub/RWin/R-2.3.1pat-win32.msi Note that this is not intended to replace the Inno Setup installer, and anyone who needs it will know what to do with it. (The local need is for remote installation/updates using RIS.) -- 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
[Rd] Shortcuts for help functions
Hi, This is a short suggestion for an improvement to R that I can code up if it is deemed sensible. While learning to use R, I found myself using help.search extensively, and would have made use of RSiteSearch had I realised that it was available. I suggest that "shortcuts" to these functions could be coded, with increasing numbers of question marks corresponding to increasing desperation on the part of the user, so that ?topic--- invokes help("topic") (as currently) ??topic --- invokes help.search("topic") ???topic --- invokes RSiteSearch("topic", restrict = c("functions", "docs")) #don't search in the mailing lists - they can be confusing to a beginner topic --- invokes RSiteSearch("topic", ) #search very widely It may be that my distinction between ??? and is too fine, and it would be preferable just to have a single invocation of RSiteSearch. I have actually coded this up: it requires minor modification of src/ main/gram.y to recognise "??", "???", and "" as valid unary operators, then addition of code such as the following to src/library/ utils/R/question.R ### Example of help.search shortcut. "??" <- function(e1) { e1Expr <- substitute(e1) e1 <- as.character(e1Expr) eval(substitute(help.search(PATTERN), list(PATTERN = e1))) } End Does this seem like a sensible idea? If so, in what form should I send the patches? I had a quick scan of the R-devel pages but couldn't easily see what the preferred method for patch submission was. Thanks Yan -- H. Y. Wong University of Leeds __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] how to include a windows dll in a package
Dear R Developers, what is the correct way to include a dll in a source package, that is expected to be installed in the libs directory? Or in general is there a better way than supplying the dll to use a third-party library (libxml2) in a package which should build on windows as well? Thank you, Gabor -- Csardi Gabor <[EMAIL PROTECTED]>MTA RMKI, ELTE TTK __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] how to include a windows dll in a package
On Tue, 15 Aug 2006, Gabor Csardi wrote: > Dear R Developers, > > what is the correct way to include a dll in a source package, that > is expected to be installed in the libs directory? You could put it in inst/libs. But we discourage that. (And if you do do this, watch out for licence conditions.) > Or in general is there a better way than supplying the dll to use a > third-party library (libxml2) in a package which should build on windows as > well? As I understand it, several package maintainers have set up arrangements with Uwe Ligges to do this, based on DLLs they have supplied him. Package XML being an example, so I suspect Uwe already knows all about libxml2. You could actually avoid this by depending on XML and arranging to have XML/libs in the PATH at load time. -- 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
Re: [Rd] how to include a windows dll in a package
Thank you for the answer. On Tue, Aug 15, 2006 at 02:09:59PM +0100, Prof Brian Ripley wrote: > On Tue, 15 Aug 2006, Gabor Csardi wrote: [...] > > what is the correct way to include a dll in a source package, that > > is expected to be installed in the libs directory? > > You could put it in inst/libs. But we discourage that. > (And if you do do this, watch out for licence conditions.) Why is this discouraged? Not that i like putting binary files into packages, i understand that this is against good taste. But is there a more serious reason? libxml2 is GPL, my package is GPL, R is GPL, so this part should be fine. > > Or in general is there a better way than supplying the dll to use a > > third-party library (libxml2) in a package which should build on windows as > > well? > > As I understand it, several package maintainers have set up arrangements > with Uwe Ligges to do this, based on DLLs they have supplied him. > Package XML being an example, so I suspect Uwe already knows all about > libxml2. You could actually avoid this by depending on XML and arranging > to have XML/libs in the PATH at load time. I don't really like depending on the XML package, since i don't actually use the functions provided by this package, i only want to use libxml2, which is not even part of the XML source package. Gabor > -- > 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 -- Csardi Gabor <[EMAIL PROTECTED]>MTA RMKI, ELTE TTK __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] how to include a windows dll in a package
Gabor Csardi wrote: > Thank you for the answer. > > On Tue, Aug 15, 2006 at 02:09:59PM +0100, Prof Brian Ripley wrote: >> On Tue, 15 Aug 2006, Gabor Csardi wrote: > [...] >>> what is the correct way to include a dll in a source package, that >>> is expected to be installed in the libs directory? >> You could put it in inst/libs. But we discourage that. >> (And if you do do this, watch out for licence conditions.) > > Why is this discouraged? Not that i like putting binary files into packages, > i understand that this is against good taste. But is there a more serious > reason? 1. It's not really nice, since GPL tells something about distributing the *sources*. Anyway, XML's binary version also ships the dll ... 2. For example, non-Windows installations won't require that dll. > libxml2 is GPL, my package is GPL, R is GPL, so this part should be fine. > >>> Or in general is there a better way than supplying the dll to use a >>> third-party library (libxml2) in a package which should build on windows as >>> well? >> As I understand it, several package maintainers have set up arrangements >> with Uwe Ligges to do this, based on DLLs they have supplied him. >> Package XML being an example, so I suspect Uwe already knows all about >> libxml2. You could actually avoid this by depending on XML and arranging >> to have XML/libs in the PATH at load time. > > I don't really like depending on the XML package, since i don't actually use > the functions provided by this package, i only want to use libxml2, which is > not even part of the XML source package. You can copy from the XML package: configure.win should contain at least: #!/bin/sh mkdir $DPKG/libs cp $LIB_XML/lib/libxml2.dll $DPKG/libs and Makevars.win can make use of ${LIB_XML}/include ${LIB_XML}/lib The name of the environment variable to the XML stuff, LIB_XML, is fixed due to my setup on the machine that build the Windows binaries. Uwe Ligges > Gabor > >> -- >> 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
Re: [Rd] how to include a windows dll in a package
On Tue, Aug 15, 2006 at 03:34:05PM +0200, Uwe Ligges wrote: > > > Gabor Csardi wrote: > >Thank you for the answer. > > > >On Tue, Aug 15, 2006 at 02:09:59PM +0100, Prof Brian Ripley wrote: > >>On Tue, 15 Aug 2006, Gabor Csardi wrote: > >[...] > >>>what is the correct way to include a dll in a source package, that > >>>is expected to be installed in the libs directory? > >>You could put it in inst/libs. But we discourage that. > >>(And if you do do this, watch out for licence conditions.) > > > >Why is this discouraged? Not that i like putting binary files into > >packages, > >i understand that this is against good taste. But is there a more serious > >reason? > > > 1. It's not really nice, since GPL tells something about distributing > the *sources*. Anyway, XML's binary version also ships the dll ... No problem, libxml2 sources are available, that is fine with the GPL. They need not be included in the _same_ package as the binaries. > 2. For example, non-Windows installations won't require that dll. That is true, so the best would be to include the dll only in windows, configure.win is good for that. [...] > You can copy from the XML package: > > configure.win should contain at least: > > #!/bin/sh > mkdir $DPKG/libs > cp $LIB_XML/lib/libxml2.dll $DPKG/libs > > and Makevars.win can make use of > ${LIB_XML}/include > ${LIB_XML}/lib > > The name of the environment variable to the XML stuff, LIB_XML, is fixed > due to my setup on the machine that build the Windows binaries. Yes, but you need to install libxml2 and set LIB_XML by hand, don't you? All in all, i would prefer the following solution if it is not against the R policy. 1. Include the libxml headers and windows DLL's in the source package. 2. The headers are used only for compiling the package on windows. 3. The DLL's are put into the windows binary package, but not used otherwise. This way no special action is needed by the user for 1. building the binary package on windows 2. installing the binary package on windows 3. building & installing the source package on unix-likes Is this good enough? Gabor > Uwe Ligges > -- Csardi Gabor <[EMAIL PROTECTED]>MTA RMKI, ELTE TTK __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] axis documentation (PR#9147)
# R for Windows will not send your bug report automatically. # Please copy the bug report (after finishing it) to # your favorite email program and send it to # # [EMAIL PROTECTED] # ## ?axis shows the description of the hadj argument: hadj: adjustment (see 'par("adj")' for all labels _parallel_ ('horizontal') to the reading direction. If this is not a finite value, the default is used (centring for strings parallel to the axis, justification of the end nearest the axis otherwise). The first line is missing a critical close-parenthesis: hadj: adjustment (see 'par("adj")') for all labels _parallel_ --please do not edit the information below-- Version: platform = i386-pc-mingw32 arch = i386 os = mingw32 system = i386, mingw32 status = major = 2 minor = 3.1 year = 2006 month = 06 day = 01 svn rev = 38247 language = R version.string = Version 2.3.1 (2006-06-01) Windows XP Home Edition (build 2600) Service Pack 2.0 Locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 Search Path: .GlobalEnv, package:HH, package:multcomp, package:mvtnorm, package:grid, package:lattice, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Using TCP/IP sockets in R
Hi All: I've examined the R documentation on sockets and while I can probably figure it out with a bit of experimentation, I wondered if anyone has some sample code they could send me. I'd like to use R as a statistics server to python clients. Is ist possible to have a multithreaded server in R? Thanks a lot, Mark Schultz __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Using TCP/IP sockets in R
Have you looked at the nws package (and the nws server from the same group), they include python to do parallel computing and may give you the examples you need. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Schultz Sent: Tuesday, August 15, 2006 12:32 PM To: R-devel@r-project.org Subject: [Rd] Using TCP/IP sockets in R Hi All: I've examined the R documentation on sockets and while I can probably figure it out with a bit of experimentation, I wondered if anyone has some sample code they could send me. I'd like to use R as a statistics server to python clients. Is ist possible to have a multithreaded server in R? Thanks a lot, Mark Schultz __ 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] Using TCP/IP sockets in R
On 15 August 2006 at 14:31, Mark Schultz wrote: | Hi All: | I've examined the R documentation on sockets and while I can probably | figure it out with a bit of experimentation, I wondered if anyone has | some sample code they could send me. I'd like to use R | as a statistics server to python clients. Is ist possible to have a | multithreaded server in R? Are you aware of Simon's Rserve project at http://www.rosuda.org/Rserve/ ? It already has Java and C++ client code -- it would be nice if you could add Python client code to this project. It is not multithreaded [ as R's core isn't, this isn't easily achievable ] but allows several properly separated connections at the same time [ when running on Linux/Unix ]. Cheers, Dirk -- Hell, there are no rules here - we're trying to accomplish something. -- Thomas A. Edison __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] configure on mac
Apologies for my ignorance about these matters. I think that the multiply defined symbols were probably my fault. After removing some lapack routines and using a modified version of Makevars suggested by Martin Maechler ## we use the BLAS and now also the LAPACK library: PKG_LIBS= $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) The multiple definitions problems don't appear, but instead I get -- trying to INSTALL quantreg -- the same problem with undefined _xerbla_ appears when I try to install Matrix. A variety of other source packages install without complaint. gcc -dynamiclib -Wl,-macosx_version_min -Wl,10.3 -undefined dynamic_lookup -single_module -multiply_defined suppress -L/sw/lib -L/usr/local/lib -o quantreg.so akj.o boot.o chlfct.o cholesky.o dsel05.o extract.o kuantile.o mcmb.o penalty.o qrcens.o rls.o rq1.o rqbr.o rqf n.o rqfnb.o rqfnc.o sparskit2.o srqfn.o srqfnc.o srtpai.o -L/Library/ Frameworks/R.framewor k/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/ lib -lRblas -L/usr/l ocal/lib/gcc/powerpc-apple-darwin8/4.0.0 -L/usr/local/lib/gcc - lgfortran -lgcc_s -lSystemS tubs -lmx -lSystem -L/usr/local/lib/gcc/powerpc-apple-darwin8/4.0.0 - L/usr/local/lib/gcc - lgfortran -lgcc_s -lSystemStubs -lmx -lSystem -F/Library/Frameworks/ R.framework/.. -framew ork R ld: warning can't open dynamic library: libR.dylib referenced from: / Library/Frameworks/R. framework/Resources/lib/libRlapack.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2) ld: Undefined symbols: _xerbla_ referenced from libRlapack expected to be defined in libR.dylib /usr/bin/libtool: internal link edit command failed _xerbla_ is in yzzy: otool -Tv libR.dylib | grep xerbla single module_xerbla_ which doesn't appear to be part of the ld above should it be? Can this be arranged by modifying Makevars? url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Champaign, IL 61820 On Aug 15, 2006, at 1:08 AM, Prof Brian Ripley wrote: > On Tue, 15 Aug 2006, stefano iacus wrote: > >> It seems that there are symbols defined in more than one header. This >> causes problems on mac. You should define the symbol in one header >> and declare elsewhere as extern. You can find examples in main.c (if >> I remember well). >> I'm not sure this is the problems, but it looks like > > One of the reasons given by Simon for this change was that was no > longer > a problem: see the last sentence of > > o MacOS X 10.3 and higher now use two-level namespaces, single > module in a shared library and allow undefined symbols to be > resolved at run-time. This implies that common symbols are now > allowed in package libraries. > > What apparently is a problem is having the same entry point in > multiple > dynamic libraries (we have had to deal with LSAME, NEWS item two > up). I > think this means that having arranged specially to satisfy symbols on > MacOS, we now need to change it, so in src/extra/blas/Makefile.in > > Rblas_la_LIBADD = @RBLAS_LDFLAGS@ @DYLIB_UNDEFINED_ALLOWED_FALSE@ $ > (FLIBS) > > '@DYLIB_UNDEFINED_ALLOWED_FALSE@' needs to be '#'. > > and we may then need to link against $(FLIBS) elsewhere. > > We need Simon's input: to the rest of us the ever-increasing number of > ways that MacOS needs special pampering is a mystery. > >> stefano >> __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] graphics documentation omission (PR#9148)
# R for Windows will not send your bug report automatically. # Please copy the bug report (after finishing it) to # your favorite email program and send it to # # [EMAIL PROTECTED] # ## ?axis says in Details: "(for example, if the 'plot' argument 'asp' is set)." The asp argument is not mentioned in ?plot and is not mentioned in ?par. --please do not edit the information below-- Version: platform = i386-pc-mingw32 arch = i386 os = mingw32 system = i386, mingw32 status = major = 2 minor = 3.1 year = 2006 month = 06 day = 01 svn rev = 38247 language = R version.string = Version 2.3.1 (2006-06-01) Windows XP Home Edition (build 2600) Service Pack 2.0 Locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 Search Path: .GlobalEnv, package:HH, package:multcomp, package:mvtnorm, package:grid, package:lattice, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] graphics documentation omission (PR#9148)
On Tue, 2006-08-15 at 21:04 +0200, [EMAIL PROTECTED] wrote: > > ?axis says in Details: "(for example, > if the 'plot' argument 'asp' is set)." > > The asp argument is not mentioned in ?plot and is not mentioned in ?par. It is referenced in ?plot.default and ?plot.window, with the former passing the 'asp' argument to the internal localWindow() function as a wrapper to the latter. In the HTML help page for ?axis, the 'asp' word in the quote above is a live link to ?plot.window. That is not helpful of course if one is working within ESS. Perhaps the See Also in ?axis should point to plot.default and plot.window? HTH, Marc Schwartz __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] graphics documentation omission (PR#9149)
Thanks, Marc Neither plot.window or plot.default are natural places for me to look for argument names. par and plot are, for me, the natural places. I realize that asp is not a par argument. Nonetheless, par is still the first place to look for arguments that I would use in the ... position of any plot function. It would be easy to make a case that asp is the same type of argument as mar or fin, thus it would make sense for it to be added to par. There are NO (that is, zero) live links in the Rgui help system. help.search("asp") doesn't find anything related to graphics. ESS is much better for help than Rgui since ESS Rd mode can go to the help page for any word that the cursor sits on. ESS for R help doesn't have the links themselves. Rich __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] graphics documentation omission (PR#9149)
On Tue, 2006-08-15 at 22:13 +0200, [EMAIL PROTECTED] wrote: > Thanks, Marc Happy to help Rich. > Neither plot.window or plot.default are natural places for me to look for > argument names. par and plot are, for me, the natural places. I realize > that asp is not a par argument. Nonetheless, par is still the first place > to look for arguments that I would use in the ... position of any plot > function. > It would be easy to make a case that asp is the same type of argument as mar > or fin, thus it would make sense for it to be added to par. Over the years, more from "behavioral modification" than from instinct, I look at ?plot.default when I forget defacto plot() arguments. Of course, plot.default() is in the See Also in ?plot. It is rare for me to look at ?plot.window, given the rarity in which I call it directly. > There are NO (that is, zero) live links in the Rgui help system. Yeah. I enabled options(htmlhelp = TRUE) in my .Rprofile for the times when I use R from the GNOME console, otherwise I am usually in ESS using emacs 22 from CVS with the XFT patches. I am not sure that I ever used the .CHM help when I used to run on Windows, but presume that there is a hyperlink in that format to parallel the live link in the HTML file. > help.search("asp") doesn't find anything related to graphics. Could be added as a \concept presumably in the .Rd files for plot.default and plot.window. For example: \concept{asp aspect ratio} > ESS is much better for help than Rgui since ESS Rd mode can go to the help > page for any word that the cursor sits on. ESS for R help doesn't have the > links themselves. Indeed. Regards, Marc __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Date and time problems
I am running R 2.3.1 on Windows XP. My machine is set (via the Windows Control Panel) to Central European time (Amsterdam, Berlin, Rome, Stockholm, Vienna) and automatically has DST set, so I am 2 hours ahead of GMT. No TZ variable is set. > Sys.timezone() [1] "W. Europe Standard Time" > Sys.Date() [1] "2006-08-15" > as.POSIXlt(Sys.Date()) [1] "2006-08-15" > as.POSIXct(Sys.Date()) [1] "2006-08-15 02:00:00 W. Europe Standard Time" > as.POSIXct(as.POSIXlt(Sys.Date())) [1] "2006-08-15 01:00:00 W. Europe Standard Time" Converting to POSIXct and converting to POSIXlt and then to POSIXct produces different results, which is rather strange. When I do > Sys.time() [1] "2006-08-16 00:12:40 W. Europe Standard Time" I get my clock time with numerically correct time for my location, but with an incorrect timezone stamp. If I set TZ=CET, something else happens. It is just past midnight, my Windows system clock shows 12:33 AM, and the date is Aug 16 (here in Austria) With TZ=CET, > Sys.Date() [1] "2006-08-15" > Sys.time() [1] "2006-08-15 22:33:30 CET" So I get current GMT time (my time - 2 hours) and date, but with a CET time stamp. When TZ does not have a value, > Sys.Date() [1] "2006-08-16" > Sys.time() [1] "2006-08-16 00:32:37 W. Europe Standard Time" This is numerically correct time and date, but with an incorrect timezone stamp. So I never get completely correct information, even when Windows timezone information is correct and TZ has the correct value. Is this something which should be corrected? -- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-39464 Fax: +43-1-4277-39459 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] List 'sssitalk' closed to public posts
Sorry, but your posting is being returned to you. The list is temporarily restricted. If your post is substantive, dealing with SSSI issues, it will be forwarded to the list. If it is intended as private email, it will be forwarded accordingly. If you wish to subscribe to SSSITALK, send a message that says: subscribe sssitalk firstname lastname (firstname/lastname are YOUR first and last name) If you have questions about SSSI, see: http://www.soci.niu.edu/~sssi If you have questions, contact: Jim Thomas at: [EMAIL PROTECTED] --- Listar v1.0.0 - job execution complete. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Date and time problems
Short answer: these are OS-specific bugs documented in the R help - see the bottom. On Wed, 16 Aug 2006, Erich Neuwirth wrote: > I am running R 2.3.1 on Windows XP. > My machine is set (via the Windows Control Panel) to Central European > time (Amsterdam, Berlin, Rome, Stockholm, Vienna) and automatically has > DST set, so I am 2 hours ahead of GMT. > No TZ variable is set. > > > Sys.timezone() > [1] "W. Europe Standard Time" > > Sys.Date() > [1] "2006-08-15" > > as.POSIXlt(Sys.Date()) > [1] "2006-08-15" > > as.POSIXct(Sys.Date()) > [1] "2006-08-15 02:00:00 W. Europe Standard Time" > > as.POSIXct(as.POSIXlt(Sys.Date())) > [1] "2006-08-15 01:00:00 W. Europe Standard Time" > > Converting to POSIXct and converting to POSIXlt and then to POSIXct > produces different results, which is rather strange. > > When I do > > Sys.time() > [1] "2006-08-16 00:12:40 W. Europe Standard Time" > > I get my clock time with numerically correct time for my location, but > with an incorrect timezone stamp. > > If I set TZ=CET, something else happens. > It is just past midnight, my Windows system clock shows > 12:33 AM, and the date is Aug 16 (here in Austria) > With TZ=CET, > > > Sys.Date() > [1] "2006-08-15" > > Sys.time() > [1] "2006-08-15 22:33:30 CET" > > So I get current GMT time (my time - 2 hours) and date, > but with a CET time stamp. > > When TZ does not have a value, > > Sys.Date() > [1] "2006-08-16" > > Sys.time() > [1] "2006-08-16 00:32:37 W. Europe Standard Time" > > This is numerically correct time and date, but with an incorrect > timezone stamp. > > So I never get completely correct information, > even when Windows timezone information is correct and TZ has > the correct value. > Is this something which should be corrected? Yes, by Microsoft. Their labelling of timezones is a known bug. E.g. I get > as.POSIXct(Sys.Date()) [1] "2006-08-16 01:00:00 GMT Daylight Time" and there is no such timezone. However, if I set my Windows XP SP2 system to your timezone I do get > as.POSIXct(Sys.Date()) [1] "2006-08-16 02:00:00 W. Europe Daylight Time" so something is wrong specific to your machine. 'CET' is not a valid timezone on Windows (where did you get that it was?), and the help (for as.POSIXlt) does say that what happens then is OS-specific. Again, it does explain that Windows has bugs in its setting of timezones so there appears to be no valid way to set programatically non-US timezones with DST on that benighted OS. -- 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