Is there a funtion simlar to "sink" that redirect also R code to a
file that
is:
sink("R001")
x <- c(2,-6,-4,8,5,4,1,3,4,-9,0,1)
A <- matrix(x, ncol=3)
A
A.prima <- t(A)
A.prima
dim(A)
dim(A.prima)
sink()
create a file "R001" with contents:
------------------------------------------
[,1] [,2] [,3]
[1,] 2 5 4
[2,] -6 4 -9
[3,] -4 1 0
[4,] 8 3 1
[,1] [,2] [,3] [,4]
[1,] 2 -6 -4 8
[2,] 5 4 1 3
[3,] 4 -9 0 1
[1] 4 3
[1] 3 4
--------------------------------------------
and what I want is a file with:
--------------------------------------------> x <- c(2,-6,-4,8,5,4,1,3,4,-9,0,1)
> A <- matrix(x, ncol=3)
> A
[,1] [,2] [,3]
[1,] 2 5 4
[2,] -6 4 -9
[3,] -4 1 0
[4,] 8 3 1> A.prima <- t(A)
> A.prima
[,1] [,2] [,3] [,4]
[1,] 2 -6 -4 8
[2,] 5 4 1 3
[3,] 4 -9 0 1
----------------------------------------------
Any hint will be appreciated
Eusebio
*************************************************************
* Eusebio Arenal Guti?rrez *
* Departamento de Estad?stica e Investigaci?n Operativa *
* _\|/_ Universidad de Valladolid *
* (o o) Espa?a *
*---oOO-(_)-OOo-----------------------------------,,,-------*
* use at eio.uva.es (o o) *
*---------------------------------------------oOO-(_)-OOo---*
* Eusebio Arenal Guti?rrez *
* Department of Statistics and Operational Research *
* University of Valladolid *
* Spain *
*************************************************************
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._