## Not run:
# xl.workbook.add()
# plot(sin)
# xl[a1] = current.graphics()
# plot(cos)
# cos.plot = current.graphics()
# xl.sheet.add()
# xl[a1] = list("Cosine plotting",cos.plot,"End of cosine plotting")
#
# # the same thing without graphic windows
# png("1.png")
# plot(sin)
# dev.off()
# sin.plot = current.graphics(filename = "1.png")
# png("2.png")
# plot(cos)
# dev.off()
# cos.plot = current.graphics(filename = "2.png")
# output = list("Cosine plotting",cos.plot,"Sine plotting",sin.plot)
# xl.workbook.add()
# xl[a1] = output
# ## End(Not run)
Run the code above in your browser using DataLab