How to write a wrapper function in R?
<p>I am writing a wrapper function. I am moving text at the command line to a variety of columns and would like to make some 'shortcut' functions with predefined defaults to assist.  I have made a small data frame and function to illustrate my issue.</p>

<pre><code>myDF = data.frame(quotes = c("dont panic", "time is an illusion", "space is big"), 
go_here = character(3), go_there = character(3), stringsAsFactors = F)
</code></pre>

<p>The function 'moveTo' is given the word I want to move (term2move) and the column I would like to move it to (placement_column).</p>

<pre><code>library(stringr)

moveTo = function(term2move, placement_column, funcDF = myDF)
{
    funcDF[,placement_column] = str_extract(funcDF$quotes, term2move)
    assign("myDF", funcDF, envir = .GlobalEnv)
}
</code></pre>

<p>To show with an example,</p>

<pre><code>moveTo("dont", "go_here")
</code></pre>

<p>places the word 'dont' in the column myDF$go_here.</p>

<p>I am looking to find out how to make a function like 'moveToGo_Here' that will only require the term2move as an argument and automatically place it in myDF$go_here. I'd then write a similar function for moveToGo_There.</p>

<p>I was hoping the following function and call would work, but it doesn't. </p>

<pre><code>moveToGo_Here = function(term2move)
{
    placement_column = "go_here"
    moveTo()
}

moveToGo_Here("illusion")
</code></pre>