I want to create a function that uses read.csv()
with paste()
. The following code works in general
df <- read.csv(paste("/file name", 2010, ".CSV", sep = ""), header = TRUE)
but when I place it inside a function like so
myfunction <- function(date){df <- read.csv(
paste("/file name", date, ".CSV", sep = ""),
header = TRUE)
}
The command myfunction(2010)
fails to produce output and does not result in any errors or warnings. What am I doing wrong?