[R] summary for weekdays()

Rui Barradas ruipbarradas at sapo.pt
Fri May 11 21:56:51 CEST 2012


Hello

Try

table(mydata$day)

Works with any type of character input.

Hope this helps,

Rui Barradas

Kai Mx wrote
> 
> 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 character
> 
> How can I get a proper summary (=count)?
> 
> Thanks,
> 
> Kai
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help@ mailing list
> 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.
> 


--
View this message in context: http://r.789695.n4.nabble.com/summary-for-weekdays-tp4627108p4627441.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list