search for: weekday

Displaying 20 results from an estimated 276 matches for "weekday".

2009 Nov 03
1
How to display full name for the coefficients/factors in summary()?
Hi, I am wondering if there is a way to display the full anme of the regression coeffients/factors in the summary? Suppose I have a bogus data set using weekday as factor which has 7 levels such as: mydata <- sample(364) wk <- rep(1:7, 52) weekday <- factor(wk,1:7,c("Mon","Tue","Wed","Thu","Fri","Sat","Sun"),ordered=T) test <- data.frame(mydata,weekday) lm.test <- lm(my...
2009 Nov 02
2
how to print the full name of the factors in summary?
Hi, I am wondering if there is a simple way to fix the problem I am having. For unknown reason, I could not get the full name of the factors to be printed in the summary. I have tried to used summary.lm as well but the problem still persists. SJ$Weekday <- factor(SJ$Weekday,1:7,c("Mon","Tue","Wed","Thu","Fri","Sat","Sun"),ordered=T) .... attach(SJ) lm.SJ <- lm(Demand ~ Weekday+Month+Holiday+Season) summary(lm.SJ) Call: lm(formula = Demand ~ Weekday + Month + Holiday + Sea...
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...
2011 Jul 22
1
Summing daily values by weekday and weekend
(Sorry for reposting. Please delete previous msgs. Thanks!) Hi, all Here I created a data frame like mydates<- seq(as.Date("2010-05-29"), length = 43, by = "day") myvalues<-runif(43,0,1) myframe<-data.frame(dates=mydates, day=weekdays(dates), value=myvalues) dates day value 1 2010-05-29 Saturday 0.14576143 2 2010-05-30 Sunday 0.37669604 3 2010-05-31 Monday 0.74813943 4 2010-06-01 Tuesday 0.34677680 ? 39 2010-07-06 Tuesday 0.69944349 40 2010-07-07 Wednesday 0.62712550 41 2010-07-08 Thursd...
2011 Jul 22
1
Summing values by weekday and weekend - based on daily dates
Hi, all Here I created a data frame like mydates<- seq(as.Date("2010-05-29"), length = 43, by = "day") myvalues<-runif(43,0,1) myframe<-data.frame(dates=mydates, day=weekdays(dates), value=myvalues) dates day value 1 2010-05-29 Saturday 0.14576143 2 2010-05-30 Sunday 0.37669604 3 2010-05-31 Monday 0.74813943 4 2010-06-01 Tuesday 0.34677680 ... 39 2010-07-06 Tuesday 0.69944349 40 2010-07-07 Wednesday 0.62712550 41 2010-07-08 Thursda...
2010 Jul 15
2
How to plot a histogram of weekday frequencies in a list of dates?
...[R] novice... Hi, I have a vector of date/times like the one shown below (a truncated sample of a much longer list...) > dates[1:4] [1] "2006-03-16 08:41:00" "2006-03-16 10:28:00" "2006-03-16 11:03:00" [4] "2006-03-16 11:04:00" I would like to generate a weekday histogram showing the frequency of dates falling on each weekday. I know that the function weekdays() gives me the weekday for each date in my vector, but the hist() function can't plot non-numeric values. There should be a function to allow me to do this simply. Any thoughts? After having don...
2012 May 11
1
summary for weekdays()
Hi all, probably really simple: I seem to be lacking some understanding for the character class: I have a bunch of dates in a dataframe and I want to add a string variable with the weekday for each date. If I use something like mydata$day <- weekdays (mydata$date), I can create subsets for each weekday (eg mydata=="Monday"), but summary (mydata$day) doesn't count the instances for each day but returns something like Length Class Mode 340 character c...
2005 Dec 16
10
Associative arrays
I just started playing with rails this week and am working on porting our existing website to rails in our navigation we have a list that has the days of the week that link to the articles for those days. this seems to be working when I had it in the template it would give me the array I was looking for so I decided to move it to the helper so that I could use it on all my templates.
2008 Sep 11
5
How to obtain a sequence of dates consisting of only weekdays
Dear R-users, How do I obtain a sequence of dates consisting of only weekdays without the weekends in R? In S, I can do the following: timeSeq(from="12/17/2007", to="8/25/2008", by="weekdays") I tried using looking at timeSequence (fSeries package) and seq.Date (base package) but I do not know if I can specify "weekdays" rather tha...
2006 Jun 23
3
Problems with weekday extraction from zoo objects
Hi Folks! I'm struggling with dates - but enough about my personal life..... I have two daily time series files. In one (x) the date format is Y/m/d and the other (y) is d/m/y. I used read.zoo on both and they read into R with no problem. Then I use: weekdays(as.Date(x$DATE)) and get what I expect - all the days of the week in my data set. When I use: weekdays(as.Date(y$Date)) I get: Error in fromchar(x) : character string is not in a standard unambiguous format I've tried to set the format= in read.zoo to format="%d/%m/%Y" bu...
2010 Mar 12
6
Randomly sampling subsets of dataframe variable
Fellow R users, I am stumped on what would seem to be something fairly simple. I have a dataframe that has a variable named 'WEEK' that takes the numbers 1:26 (26 week time-period) with each number repeated five times consecutively (once for each weekday, Monday through Friday). Ex. 111112222233333.....2626262626. I would like to randomly extract two weekdays per five day week for each of 26 weeks and store this data as a separate dataframe. I have been unable to get the sample function to work properly. I have also tried using the runif functio...
2010 Oct 04
2
Generating weekdays only
Dear all, can anyone please tell me how to generate a sequence of days continuously, however without considering weekends i.e. Saturday and Sunday? I am aware of following code: > seq(as.Date("2010-01-01"), as.Date("2010-02-01"), by="1 day")  [1] "2010-01-01" "2010-01-02" "2010-01-03" "2010-01-04" "2010-01-05"
2002 Feb 22
1
Weekdays
Hello, I'm trying to write a function that returns the number of weekdays between a vector of start dates and a vector of end dates. Subtracting the 2 times the number of whole weeks is the easy part and works if the number of days is a multiple of 7. However, the number of weekend days in the tail is a little harder. It depends on both the start date of the tail and...
2011 Jul 22
0
Summing values by weekday and weekend
Sorry for reposting. The previous message not showing up. Hi, all Here I created a data frame like mydates<- seq(as.Date("2010-05-29"), length = 43, by = "day") myvalues<-runif(43,0,1) myframe<-data.frame(dates=mydates, day=weekdays(dates), value=myvalues) dates day value 1 2010-05-29 Saturday 0.14576143 2 2010-05-30 Sunday 0.37669604 3 2010-05-31 Monday 0.74813943 4 2010-06-01 Tuesday 0.34677680 … 39 2010-07-06 Tuesday 0.69944349 40 2010-07-07 Wednesday 0.62712550 41 2010-07-08 Thursday...
2007 Aug 23
4
Idiomatic way to do a non-database Enumeration?
I have a class which stores as one of its attributes a day of the week as an integer (0-6, 0=Sunday, standard UNIXy values). I want, obviously, the views to show the weekday name and the forms to provide a drop-down with the weekday names. Essentially it''s a vrtual attribute whose value is the localized weekday name, which maps to the integer value that''s actually stored. There are a lot of approaches, but I was wondering what the idiomatic Rails-...
2017 Jun 05
2
months not working with local language (weekdays does)
For what it's worth, I tried setting my Region | Formats setting to Spanish (Peru) in Windows 10 Control Panel, and got Spanish weekday and month results. I believe on Windows we use the Microsoft C strftime function to produce these strings, with the %A (for weekday) or %B (for month) formats. So this question probably needs to be addressed to Microsoft. Duncan Murdoch On 05/06/2017 3:21 PM, Rui Barradas wrote: > Hello,...
2007 Mar 07
2
No years() function?
Hi, I'm trying to aggregate date values using the aggregate function. For example: aggregate(data,by=list(weekdays(LM),months(LM)),FUN=length) I would also like to aggregate by year but there seems to be no years() function. Should there be one? Is there any alternative choice? Also, a hours() function would be great. Any tip on this? Thanks in advance! S?rgio Nunes
2010 May 17
6
Change order of columns in table?
I'm an R noob and have a (maybe) stupid question... I have a table where I have the weekdays and a number for each weekday of entries: Thats what the table looks like... Now I want to have an pie3D plot of this, but obviously the order of the weekdays are not as one would expect... Friday Monday Saturday Sunday Thursday Tuesday Wednesday 119 173 80...
2017 Jun 05
0
months not working with local language (weekdays does)
...ment, before assuming it's a problem with my PC/configuration. 2017-06-05 14:37 GMT-05:00 Duncan Murdoch <murdoch.duncan at gmail.com>: > For what it's worth, I tried setting my Region | Formats setting to > Spanish (Peru) in Windows 10 Control Panel, and got Spanish weekday and > month results. > > I believe on Windows we use the Microsoft C strftime function to produce > these strings, with the %A (for weekday) or %B (for month) formats. So > this question probably needs to be addressed to Microsoft. > > Duncan Murdoch > > > On 05/06/20...
2017 Jun 05
0
months not working with local language (weekdays does)
Hello, This doesn't answer the question, but in portuguese it works as expected. > x <- as.Date("2017-06-05") > months(x) [1] "junho" > weekdays(x) [1] "segunda-feira" > sessionInfo() R version 3.4.0 (2017-04-21) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 Matrix products: default locale: [1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252 [3] LC_...