I have a dataframe z and I want to create the new column based on the values of two old columns of z. Following is the process:
z
&g
I really liked the answer "dinre" posted to flodel's blog:
for (i in 1:length(data_Array)){ data_Array[i] <- switch(data_Array[i], banana="apple", orange="pineapple", "fig") }
With warnings about reading the help page for switch carefully for integer arguments.
switch