Q:

generating R images dynamically

There are bunch of files that are updated on a directory called: c:/files. These files are R data files that have R ojects in them. When I load these files, I get different objects that have data in them. For example, if I load the opening.R file, I get ojects like opening.stock, opening.options, opening.bonds etc. I like to load each of these .R files and go though them and create images based on objects and them them as file name plus object name .png. Below is my code but it is not quite working. I can load the file and read the ojects. But when I try to read the content of the objects, it is not working. Any ideas, what I am doing wrong:
for (file in dir("c:\\files" ,pattern = "OPENING")){
load(file)

    for (object in ls()) {
        ## if I like to see the content of the oject
        ## I do this
        ### print(oject) 
        ### this does not work, it just prints oject, not the content of objects   
        png("file+ojbect.png")
        plot(object)
        dev.off()
    }
}

I used get(oject) as suggested by @Ben Bolker but I have another issue now. I have a date column that that I have to convert to as.Date and sort it so that it plots well as below:
     x=as.data.frame(get(oject))
    x$Date<- as.Date(x$Date, format="%Y-%m-%d")
    x<- x[order(as.Date(x$Date, format="%Y-%m-%d")),]

I get this error:
Error in as.Date.default(x$Date, format = "%Y-%m-%d") :
  do not know how to convert 'x$Date' to class "Date"
Calls: as.Date -> as.Date.default
Execution halted

I am still having problems. First iteration work but when it comes to the second file, it chokes:
suppressMessages(library(ggplot2))
suppressMessages(library(gridExtra))
suppressMessages(library(timeDate))

    for (i in dir("c:\\tmp" ,pattern = "OPENNING")){
        setwd("C:/tmp") 
        load(i)
        print(i)
        Sys.sleep(5)
            for (object in ls()) {
                x<-data.frame(get(object))
                print(x)
                x$Date<-as.Date(timeDate(x$Date))      
                x[order(x$Date),] 
                png((openning.png",sep="")
                Plot(x)
                dev.off()
            }
    }

error:
Error in `$<-.data.frame`(`*tmp*`, "TimeStamp", value = numeric(0)) :
  replacement has 0 rows, data has 7
Calls: $<- -> $<-.data.frame
Execution halted

Please dont down vote my post if you dont have any input. How else am I supposed to ask this question.

A:

Try this for the date problem:
 x=as.data.frame(get(object))
    x$Date<- as.Date(x$Date, format="%Y-%m-%d")
    x<- x[order(x$Date)),]   
 # if the conversion was successful a Date class object can be ordered

