Skip to content
Prev 306510 / 398506 Next

Simple Question

On Sep 27, 2012, at 11:13 PM, Bhupendrasinh Thakre wrote:

            
If you want to assign a value to a character-name you need to use ... `assign`. You cannot just stick a numeric value which is what you get with sys.Time() on the LHS of a "<-" and expect R to intuit what you intend.

?assign
assign( "a_2012_09_27_00_12_30" ,  rnorm(1,2,1) )
assign( as.character(unclass(Sys.time())) ,  rnorm(1,2,1) )

(I would have thought you wanted to format that sys.Time result:)
[1] "2012_09_27_23_32_40"
[1] "2012_09_27_23_33_45"
BT; Please learn to post in plain text. It's really very simple with gmail.