R Language                
            式:解析+評価
        
        
            
    サーチ…
備考
関数parse 、テキストとファイルを式に変換します。 
関数evalは式を評価します。 
文字列形式でコードを実行する
この例では、文字列形式で格納されたコードを実行します。
# the string
str <- "1+1"
# A string is not an expression.
is.expression(str)
[1] FALSE
eval(str)
[1] "1+1"
# parse convert string into expressions
parsed.str <- parse(text="1+1")
is.expression(parsed.str)
[1] TRUE
eval(parsed.str)
[1] 2
Modified text is an extract of the original Stack Overflow Documentation
        ライセンスを受けた CC BY-SA 3.0
        所属していない Stack Overflow