[R] R problem

Chel Hee Lee chl948 at mail.usask.ca
Sat Jan 31 17:53:22 CET 2015


 > ex <- strptime(c("2014-01-30 15:39:46", "2012-04-20 14:49:02"), 
format="%Y-%m-%d %H:%M:%S")
 > ex
[1] "2014-01-30 15:39:46 CST" "2012-04-20 14:49:02 CST"
 > format(ex, format="%a")
[1] "Thu" "Fri"
 > format(ex, format="%A")
[1] "Thursday" "Friday"
 > weekdays(ex)
[1] "Thursday" "Friday"
 >

Is this what you are looking for?  I hope this helps.

Chel Hee Lee


On 1/31/2015 3:06 AM, Camilla Timo wrote:
> Hi there,
> I have a problem, i have a dataset, in which there are time series from 2010- to 2014, like this:
> -2014-01-30 15:39:46
> -2012-04-20 14:49:02
>   And so on .
> I want to have a situation in which there are days of week expressed in word, because I have to calculate days of week and on the other hand week end. For example, i want :
> -2014- 01 monday 15:39:46
> -2012-04 saturday 14:49:02
> Thanks guys
>
> Inviato da iPhone
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list