Displaying 20 results from an estimated 6000 matches similar to: "Days of the week?"
2011 May 14
2
changing the day of the week in dates format
Dear all,
I have a question related to the POSIXlt function in R.
I have a set of dates and times, for exmaple:
startx <- as.POSIXct("2011-01-01 00:00:00")
finx <- as.POSIXct("2011-12-31 00:00:00")
daysx<- seq(startx, finx, by="24 hours")
I
want to change the dates of all the days falling on a Saturday to the
next working day (i.e. Monday). So I
2008 Mar 23
2
Can not install fCalendar package under R 2.6.2
Dear R helper:
When I was trying to install the fCalendar package, R report the
following error and then my installation failed:
* Installing *source* package 'fCalendar' ...
** R
** inst
** preparing package for lazy loading
Loading required package: MASS
Loading required package: fEcofin
Loading required package: fUtilities
Loading required package: RUnit
RUnit 0.4.17 loaded.
2006 Aug 10
2
day, month, year functions
Hi list,
I'm trying to turn a date into something productive. (Not what you may be thinking....)
I want three functions so I could take a "date" object and get the day of week, month, and year from it.
xx <- as.Date("2006-01-05")
month(xx) equal 1
day(xx) equal 5
year(xx) equal 2006
I'm aware of the weekdays() and months() functions in the base package. But
2006 Aug 10
3
Is there a better way than x[1:length(x)-1] ?
Hi WizaRds,
In MATLAB you can do
x=1:10
and then specify
x(2:end)
to get
2 3 4 5 6 7 8 9 10
or whatever (note that in MATLAB the parenthetic index notation is used, not brackets as in R). The point is that 'end' allows you to refer to the final index point of the array.
Obviously there isn't much gain in syntax when the variable name is x, but when it's something like
2008 Dec 11
3
getting ISO week
Hi all,
Is there a simple function already implemented for getting the ISO
weeks of a Date object?
I couldn't find one, and so wrote my own function to do it, but would
appreciate a pointer to the "default" way. If a function is not yet
implemented, could the code below be of interest to submit to CRAN?
Best Regards,
Gustaf
--------------------
2013 Oct 04
2
Possible POSIXlt / wday glitch & bugs.r-project.org status
Wanted to raise two questions:
1. Is bugs.r-project.org down? I haven't been able to reach it for two or three days:
```
ping bugs.r-project.org
PING rbugs.research.att.com (207.140.168.137): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
2007 Oct 15
3
for loop if else conditional
date <- as.POSIXlt(Sys.time()) #present date
for (i in 1:difftime(as.POSIXlt(Sys.Date()),"2007-10-01"))
if (date$wday != 0 & date$wday != 6) {print(date);assign("date",
(date-86400))} else (assign("date", (date-86400)))
I am trying to print dates from present day to a day in the past, but
omitting weekends. I am not doing something right, but can't
2007 Oct 16
1
try / tryCatch for download.file( ) within a for loop when URL does not exist
I am trying to download a bunch of files from a server, for which I am
using download.file( ) within a for loop. The script is working fine
except until download.file hits a URL which has no file, at which
point it exits. I want to change this behavior to simple log the
failure and maintain state within the for loop and iterate to next. I
read about try / tryCatch but am having trouble
2007 Dec 11
0
holidayNYSE missing some
John Putz wrote:
> Thanks.
>
> */
> email: /**/johnputz3655@yahoo.com/* <mailto:johnputz3655@yahoo.com>
> */home: 206-632-6522
> cell: 206-910-5229/*
>
>
> ----- Original Message ----
> From: Joe W. Byers <ecjbosu@aol.com>
> To: John Putz <johnputz3655@yahoo.com>
> Cc: r-sig-finance@stat.math.ethz.ch
> Sent: Friday, December 7, 2007
2020 Oct 23
2
The presence/absence of `zone` in POSIXlt depending on time zone as a cause of possible inconsistences?
Dear all,
I have just detected what seems a minor inconsistence with data types. If one unlists a POSIXlt time with GMT zone gets a numeric vector, since the POSIXlt list has no `zone` element, while if one unlists a POSIXlt time with a non GMT zone (also non specifying tz if the Sys.timezone is not GMT) gets a character vector due to including the `zone` element.
> x <-
2020 Oct 01
3
timezone tests and R-devel
The return value of Sys.time() today with a timezone of US/Eastern is
unchanged between 4.0.3-patched and devel, but on devel the following test
fails
all.equal(x, as.POSIXlt(x))
with
x = Sys.time()
This means that devel does not complete make tests (failure on
tests/reg-tests-2.R)
It is entirely possible that it is an error on my end, I use
export TZ="US/Eastern"
but I have been
2005 Oct 06
2
isdst
Can someone, please, explain the difference is results below (notice
the isdst value)
> unlist(as.POSIXlt('2005-7-1'))
sec min hour mday mon year wday yday isdst
0 0 0 1 6 105 5 181 1
> unlist(as.POSIXlt(as.Date('2005-7-1')))
sec min hour mday mon year wday yday isdst
0 0 0 1 6 105 5 181 0
2007 Oct 15
1
String concatenation, File Path Handling to pass to download.file( ) [backslash in DOS paths]
Gabor,
Thanks much. Your solution is elegant. My overall scheme is to take
present date, and check whether it is a weekend, if not, then create a
string based on the date, to concatenate into a url link for
download.file( ). The files I need to download have a part which is in
the format: mmddyy. I am working to make myself a system to connect to
exchanges, and download end of day files from
2007 Dec 11
3
Wrong length of POSIXt vectors (PR#10507)
Full_Name: Petr Simecek
Version: 2.5.1, 2.6.1
OS: Windows XP
Submission from: (NULL) (195.113.231.2)
Several times I have experienced that a length of a POSIXt vector has not been
computed right.
Example:
tv<-structure(list(sec = c(50, 0, 55, 12, 2, 0, 37, NA, 17, 3, 31
), min = c(1L, 10L, 11L, 15L, 16L, 18L, 18L, NA, 20L, 22L, 22L
), hour = c(12L, 12L, 12L, 12L, 12L, 12L, 12L, NA, 12L,
2006 Nov 28
1
Can anyone read a S-PLUS .dmp file for me?
Hi WizaRds,
I tried reading the S-PLUS file
ftp://ftp.research.att.com/dist/bayes-meta/hblm.dmp
into R using
data.restore("hblm.dmp")
but I got an error:
Error in attributes(value) <- thelist[-match(c(".Data", ".Dim", ".Dimnames", :
row names must be 'character' or 'integer', not 'double'
In
2020 Oct 02
2
timezone tests and R-devel
Yes, the potential issue I see is that
make check
fails when I explicitly set TZ. However, I set it to be the same as what
the system reports when I login.
Details: The system (RHEL) I am working on has
$ strings /etc/localtime | tail -n 1
EST5EDT,M3.2.0,M11.1.0
$ date +%Z
EDT
$ echo $TZ
US/Eastern
On Fri, Oct 2, 2020 at 9:48 AM Sebastian Meyer <seb.meyer at fau.de> wrote:
> Thank
2017 May 17
2
R-3.4.0 fails test
After installing R-3.4.0 I ran 'make check' which halted here:
$ > tail reg-tests-1d.Rout.fail -n 16
> ## format()ing invalid hand-constructed POSIXlt objects
> d <- as.POSIXlt("2016-12-06"); d$zone <- 1
> tools::assertError(format(d))
> d$zone <- NULL
> stopifnot(identical(format(d),"2016-12-06"))
> d$zone <- "CET" # =
2009 Mar 05
1
Problem using RMySQL and fCalendar
Hello:
I am trying to use fCalendar for date arithmetic and the RMySQL package
for accessing a MySQL database. The fCalendar math operations seem to
work fine UNTIL I load the RMySQL package. Here is a demonstration:
ean at fibonacci:~/Desktop/amCharts/rsa-metrics$ R
R version 2.7.1 (2008-06-23)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free
2006 Aug 01
1
Tcltk package
Hi WizaRds,
I ran into trouble trying to install the "debug" package, which requires TCL/TK support. It seems like the tcltk package is not installed on my system.
From: http://tolstoy.newcastle.edu.au/R/help/05/07/7993.html it seems that the tcltk is bundled with the base R distribution.
I'm running R under linux:
> version
_
platform i686-pc-linux-gnu
2012 Apr 22
2
difficulty in Formatting time series data
Dear R-Gurus
I have a data frame (from CSV file) which has its first column called Date.
The Date is in the format mm/dd/yyyy. I was trying to get the weekday for
these dates and I tried using wday() and day.of.week() functions and both
of them gave me precisely the wrong answers. I think the issue lies in the
proper formatting of dates. The class of this column is a factor class and
hence I