In the function below:
DownloadRawData <- function(fileurl, filename)
{
download.file(fileurl, destfile=filename)
dataset = read.csv(filename)
return(dataset)
}
myDataSet <- downloadRawData(myurl, myname)
Are we going to allocate 2 copies of the dataset in memory at the function return, or the assignment will be by reference.
This thread R, deep vs. shallow copies, pass by reference give some hints about it, but it was not that clear to me.
Another similar example would be:
f <- function(n)
{
v <- c(1:n)
v <- sample(v,n)
return(v)
}
myV <- f(10000)