Displaying 20 results from an estimated 20000 matches similar to: "FW: is.weekend() odd behaviour"
2004 May 26
3
is.weekend() odd behaviour
It seems is.weekend() is unsure ?
# Start R 1.9.0 with --vanilla on windows xp
# load package chron
> table(is.weekend(sapply(1:100, function(i){Sys.sleep(0.05);Sys.time()})))
FALSE TRUE
68 32
> date()
[1] "Wed May 26 11:18:56 2004"
> version _
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
2001 Sep 07
1
chron is.weekend() function
Hello,
I have a dataset which has fields giving both calendar date and weekday. I
know better functions are now available, but I am still using chron because
of the is.holiday() function and a homemade (even Heath Robinson would be
ashamed) is.daylight() function.
As a check for typos in the data input, I checked that the dates matched the
weekdays. I'm getting some confusing results
2017 Jun 22
1
Unexpected behaviour of base::qr()$rank
2017-06-22 20:31 GMT+02:00 Uwe Ligges <ligges at statistik.tu-dortmund.de>:
>
>
> On 22.06.2017 20:09, I?aki ?car wrote:
>>
>> 2017-06-22 19:49 GMT+02:00 Uwe Ligges <ligges at statistik.tu-dortmund.de>:
>>>
>>> On 22.06.2017 17:11, Bernd Funovits wrote:
>>>>
>>>>
>>>> Hello,
>>>>
>>>> I
2005 Dec 09
3
[R] data.frame() size
Hi,
Please see below for post on r-help regarding data.frame() and the
possibility of dropping rownames, for space and time reasons.
I've made some changes, attached, and it seems to be working well. I see the
expected space (90% saved) and time (10 times faster) savings. There are no
doubt some bugs, and needs more work and testing, but I thought I would post
first at this stage.
Could some
2001 Jan 11
3
Reformatting dates using chron
Hello All:
I am trying to generate a sequence of dates using library(chron). Using the following code, I got most of what I want,
dts <- seq.dates("01/02/1998", "01/10/2001", by="day")
dts <- dts[!is.weekend(dts)]
a sequence of weekdays only (no weekend dates), with first observation appearing as 01/02/98 and the last 01/10/01. But I would
2017 Jun 22
2
Unexpected behaviour of base::qr()$rank
2017-06-22 19:49 GMT+02:00 Uwe Ligges <ligges at statistik.tu-dortmund.de>:
> On 22.06.2017 17:11, Bernd Funovits wrote:
>>
>> Hello,
>>
>> I experienced some unexpected behaviour while determining the rank of matrices (sometimes 1x1 matrices):
>> base::qr(matrix(1e-20))$rank returns 1 (incorrect)
>> base::qr(diag(c(1, 1e-20)))$rank returns 2
2017 Jun 22
0
Unexpected behaviour of base::qr()$rank
On 22.06.2017 20:09, I?aki ?car wrote:
> 2017-06-22 19:49 GMT+02:00 Uwe Ligges <ligges at statistik.tu-dortmund.de>:
>> On 22.06.2017 17:11, Bernd Funovits wrote:
>>>
>>> Hello,
>>>
>>> I experienced some unexpected behaviour while determining the rank of matrices (sometimes 1x1 matrices):
>>> base::qr(matrix(1e-20))$rank returns 1
2003 Sep 17
3
Using POSIX?t rather than "chron" or "date"
The problem with POSIXt is that you must consider timezones
and daylight vs. standard time issues even if you don't want
to. This violates modularity (viz. your routines becomes coupled
to unrelated information) and leads to subtle errors where different
routines are assuming different time zones.
The problem is that the time, date, day of the week, month, etc.
of a date depend on its
2003 Jun 12
0
Re: (PR#3241) write.table() fails for POSIXlt class and NAs in
Uwe,
You said you used
testdata <-
data.frame(date = strptime(c("31121991", "31121991"), "%d%m%Y"),
nothing = c(NA, NA))
but that's not the same object, and that one does work for me.
> dput(testdata)
structure(list(date = structure(c(694137600, 694137600), class = c("POSIXt",
"POSIXct")), nothing = c(NA, NA)),
2006 Mar 02
5
Deparsing '...'
Hi,
The following function works, but is there a neater way to write it?
f = function(x,...)
{
# return a character vector of the arguments passed in after 'x'
gsub("
","",unlist(strsplit(deparse(substitute(list(...))),"[(,)]")))[-1]
}
> f(x,a,b,c*d)
[1] "a" "b" "c*d"
>
Thanks.
[[alternative HTML
2008 Sep 29
1
describe function in package Hmisc and function format.dates in chron (PR#13087)
Full_Name: Kem Phillips
Version: 2.7.1 (2008-06-23)
OS: Windows Xp professional
Submission from: (NULL) (98.221.200.108)
The Hmisc function describe fails, giving the error message:
Error in formatDateTime(dd, atx, !timeUsed) :
could not find function "format.dates"
Loading the chron package, where function dates apparently resides, does not
fix the problem. Note
2006 Jul 14
2
chron vs. POSIX
Hi,
One of the big decisions when writing code is how to handle dates and
times. Gabor Grothendieck provided an excellent overview of the issue in
his R News 4/1 (2004) article, and many users and developers are probably
using it as a guide. The proposed guideline is to use the simplest class
required; as Gabor put it "use Date if possible, otherwise use chron, and
otherwise use
2011 Jan 17
0
Fw: Re: help in calculating ar on ranked vector
--- On Mon, 1/17/11, Raymond Wong <raywong365@yahoo.ca> wrote:
From: Raymond Wong <raywong365@yahoo.ca>
Subject: Re: [R] help in calculating ar on ranked vector
To: "Uwe Ligges" <ligges@statistik.tu-dortmund.de>
Received: Monday, January 17, 2011, 11:56 AM
Thanks Uwe:
Here is my code. the first set of print statements work, but not the second.
#
2008 Aug 01
1
chron objects: input/output
Hi list, I have some questions regarding
1) conversion of date + time characters to chron
2) formatting chron object printing
Regarding (1), Gabor's Rnews 2004 4/1 article has been indispensible,
but I often work with files where dates and times are contained in a
single field. In this case, I would like to control input/output of
chron objects when each observation of date and time is
2008 Nov 19
2
Exclude holidays in a subset of dates?
Hi All,
I am iterating through dated materials, with variable start and end dates,
and would like to skip procedures everytime I encounter a weekend or
holiday. To do this, I thought the easiest way would be to create a
TRUE/FALSE vector corresponding to each day where it is TRUE if a workday,
and FALSE if a weekend or holiday.
So far I have been able to do this for weekdays:
startDate <-
2004 Mar 01
6
Find out the day of week for a chron object?
I know that this is correct:
library(chron)
x = dates("01-03-04", format="d-m-y", out.format="day mon year")
print(x)
It gives me the string "01 Mar 2004" which is correct.
I also know that I can say:
print(day.of.week(3,1,2004))
in which case he says 1, for today is monday.
My question is: How do I combine these two!? :-) I have a
2015 Aug 12
0
download.file() on ftp URL fails in windows with default download method
Hi David,
----- Original Message -----
> From: "David Smith" <davidsmi at microsoft.com>
> To: "Dan Tenenbaum" <dtenenba at fredhutch.org>, "Uwe Ligges" <ligges at statistik.tu-dortmund.de>, "Elliot Waingold"
> <Elliot.Waingold at microsoft.com>
> Cc: "R-devel at r-project.org" <r-devel at r-project.org>
2007 Dec 13
1
counting weekday in a month in R
Hi,
I am trying to count weekday of the month using R. For example, 1/4/2001
is the 4th weekday of Jan, and 1/5/2001 is the 5th weekday of the month, and
1/8/2001 is the 6th weekday of the month, etc. I get as far as extracting
the weekdays from a sequence of dates (see below). But I have not yet
figured out a fast way of counting without using a For Loop. Does anyone
know how to do such counting
2009 Jan 04
1
POSIXct and chron issues with tz
Dear All-
I am trying to merge two data files - they have different date formats
and different times zones. I need to match up the date/time of the
datasets and then invoke a conditional statement, such as: if dataC$mph
is >= 12 then keep dataM$co23 for the corresponding time/date stamp.
snippets of data files:
*dataC.txt*
LST in mph Deg DegF DegF2 % volts Deg
2003 Dec 15
3
Julian Dates
Hi,
I'm a bit confused how julian() works. If I understand right, it returns
the number of days since the origin.
I have a vector:
> SLDATX[1:10]
[1] "1986-01-06" "1986-01-17" "1986-02-02" "1986-02-04"
[5] "1986-02-04" "1986-02-21" "1986-03-06" "1986-03-25"
[9] "1986-04-06"