http://rmarkdown.rstudio.com. Knit includes both content as well as the output
rm( list = ls() )
ls()
## character(0)
mywd <- "H:/DataR"
setwd( mywd )
getwd( )
## [1] "H:/DataR"
x <- 1:10
y <- matrix( 1:6, nrow = 2, ncol = 3 )
x
## [1] 1 2 3 4 5 6 7 8 9 10
y
## [,1] [,2] [,3]
## [1,] 1 3 5
## [2,] 2 4 6
ls()
## [1] "mywd" "x" "y"
ls()
## [1] "mywd" "x" "y"
dump( c("x", "y"), file = "mydump.txt")
ls()
## [1] "mywd" "x" "y"
rm(x); rm(y)
ls()
## [1] "mywd"
source( file = "mydump.txt" )
ls()
## [1] "mywd" "x" "y"
x <- 1:10
y <- matrix( 1:6, nrow = 2, ncol = 3 )
x
## [1] 1 2 3 4 5 6 7 8 9 10
y
## [,1] [,2] [,3]
## [1,] 1 3 5
## [2,] 2 4 6
dput( y, file = "mydput.txt" )