how about:
t.d <- data.frame(col1=c("31*","0","102*","71*","31","66","47"),
col2=c("66","0*","66","80","2*","31*","38*"),
stringsAsFactors = FALSE)
t.x <- apply(t.d,1,function(x) x[order(unlist(x)==grep("\\*$",
unlist(x),value=TRUE))])
t.d2 <- data.frame(col1=t.x[1,],col2=sub("\\*$","",t.x[2,]))
greets
christian
--
Christian Bieli, project assistant
Institute of Social and Preventive Medicine
University of Basel, Switzerland
Steinengraben 49
CH-4051 Basel
Tel.: +41 61 270 22 12
Fax: +41 61 270 22 25
[EMAIL PROTECTED]
www.ispm-unibasel.ch
______________________________________________
[email protected] 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.