How to use a dynamic data frame name in a function in R
<p>I am creating a dynamic data frame name using system date. The code is as follows.</p>

<pre><code>date = Sys.Date()-1
date1 = paste("",date,"",sep="")
titlerepo = paste("GA",format(Sys.Date()-1,format = "%d"),format(Sys.Date()-1,format = "%b"),"AppData",sep="")
</code></pre>

<p>Here the result I get is titlerepo = "GA03MarAppData".</p>

<p>I use this further down the script to store a value so that it becomes a data frame.</p>

<pre><code>assign(paste("GA",format(Sys.Date(),format = "%d"),format(Sys.Date(),format = "%b"),"AppData",sep=""),read.csv(pathapp,header = FALSE,sep = ",",comment.char = "#"))
</code></pre>

<p>Now I want to use this name and want to perform functionalities that are there for a data frame name like</p>

<pre><code>names(GA04MarAppData)[1] = "SN" 
names(GA04MarAppData)[2] = "USWin"
GA04MarAppData[grep("^/p/",(paste("GA",format(Sys.Date(),format = "%d"),format(Sys.Date(),format = "%b"),"AppData$ScreenName",sep=""))),]
</code></pre>

<p>but I am unable to use it this way.</p>

<p>I have tried the following code but with no success.</p>

<pre><code>assign(paste("names(","GA",format(Sys.Date(),format = "%d"),format(Sys.Date(),format = "%b"),"AppData)[1]",sep=""),"ScreenName")

names(titlerepo)[1] = "ScreenName"
names(titlerepo)[2] = "UniqueScreenView"
</code></pre>