[R] ordering by a datframe date

Bob Green bgreen at dyson.brisnet.org.au
Sun Aug 6 06:42:35 CEST 2006


I am hoping for some advice regarding ordering a dataframe, by date.

The dataframe is in the format below.

$story		$datepub
story10      1 April 1999
story 90    1 March 2002
story 37    10 July 1985

	
I want to reorder the entire dataframe so the earliest story is first, and 
save the reordered dataframe. The command, 'class' (datepub) reveals 
$datepub is a factor variable.

I tried the following:

d2 <- as.character(datepub)
rank(d2)

Any assistance is appreciated,

regards

Bob Green



More information about the R-help mailing list