Hi,

I guess you just want to reshape your data to wide format.

strs <- "Index Time Value
1 2 0.1
2 3 0.2
3 1 0.3"
DF <- read.table(textConnection(strs),header=T)
rDF <- reshape(DF, idvar="Index", timevar="Time", direction="wide") 
rDF[is.na(rDF)] <- 0

-----
A R learner.
-- 
View this message in context: 
http://r.789695.n4.nabble.com/matrix-problem-tp2320193p2320287.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org 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.

Reply via email to