Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Dynamic-variable-names/R/dynamic-variable-names.r
Normal file
10
Task/Dynamic-variable-names/R/dynamic-variable-names.r
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Read the name in from a command prompt
|
||||
varname <- readline("Please name your variable >")
|
||||
# Make sure the name is valid for a variable
|
||||
varname <- make.names(varname)
|
||||
message(paste("The variable being assigned is '", varname, "'"))
|
||||
# Assign the variable (with value 42) into the user workspace (global environment)
|
||||
assign(varname, 42)
|
||||
#Check that the value has been assigned ok
|
||||
ls(pattern=varname)
|
||||
get(varname)
|
||||
Loading…
Add table
Add a link
Reference in a new issue