Re: [R] source() behavior I don't understand

2008-03-09 Thread jim holtman
Put 'print' around your variable: > temp.ttt <- "ttt <- 1\nprint(ttt)" > conn.ttt <- textConnection(temp.ttt) > source(conn.ttt, echo=TRUE) ## name of variable is echoed > ttt <- 1 > print(ttt) [1] 1 > close(conn.ttt) > cat(file="c:/temp/temp.R", temp.ttt) ## name of variable not echoed > sour

[R] source() behavior I don't understand

2008-03-09 Thread Richard M. Heiberger
temp.ttt <- "ttt <- 1\nttt" conn.ttt <- textConnection(temp.ttt) source(conn.ttt, echo=TRUE) ## name of variable is echoed close(conn.ttt) cat(file="c:/temp/temp.R", temp.ttt) ## name of variable not echoed source("c:/temp/temp.R", echo=TRUE) temp.abc <- "abc <- 1\nabc" conn.abc <- textConnecti