Hi Trying,
Jim already suggested youuse write.table(), which I think is really
what you want. I also wanted to point out that your outer loop is
unnecessary. The following yields identical results and is *much*
faster.
randz <- matrix(rnorm(100), 500, 2000)
H <- matrix(0, 500, 2000)
H[1, ]
try
write.table(H, file = "datad,txt")
On Sun, May 6, 2012 at 5:02 PM, Trying To learn again
wrote:
> Hi all,
>
> I´m trying to use write function to save the output of a program (my
> constructed "H" matrix)
>
>
> randz<-matrix(rnorm(100),500,2000)
>
> H<-matrix(0,500,2000)
>
> H[1,]<-randz
Hi all,
I´m trying to use write function to save the output of a program (my
constructed "H" matrix)
randz<-matrix(rnorm(100),500,2000)
H<-matrix(0,500,2000)
H[1,]<-randz[1,]
for (j in 1:2000){
for (i in 2:500){
if(i<251)
H[i,j]<-0.6*H[i-1,j]+randz[i,j]
else H[i,j]<-H[i-1,j]+randz[i,j]
3 matches
Mail list logo