If statements with variables in the form of words in r -


this incredibly simple question. if have variable defined word such as:

variable1 = 'returns' 

this later edit (i.e. change 'returns' 'revenue').

i want execute particular block of code provided variable 'returns'. why r tell me cannot use = sign when try:

if(variable1 = 'returns'){ #code go here } 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -