I have the following in a CSV file and I want to have them the same format, below, in R
01:00:00 02:00:00 03:00:00
15 80 67
30 44 2
I've been able to put them in a single variable
textus="01:00:00 02:00:00 03:00:00
15 80 67
30 44 2"
Then
data <- unname(as.matrix(read.table(text = textus)))
After, I'm trying to put them together with the following command line:
data1 <- rep(data[1,],data[2,],data[3,])
But it keeps giving me the following error lines:
Message d'avis :
In rep(dat[1, ], dat[2, ], dat[3, ]) :
seul le premier élément de l'argument 'length.out' est utilisé
The error is in french, to make things worse.
I've tried the following and it works even if it is only doing half of what I wish R to do:
data1<-rep(dat[1,],dat[2,])
# results
01:00:00 02:00:00 03:00:00
15 80 67
data2<-rep(dat[1,],dat[3,])
# results
01:00:00 02:00:00 03:00:00
30 44 2
If you have any input of what I'm missing, I will be glad to listen.
Best.