[R] Can data.frame be saved as image?

jim holtman jholtman at gmail.com
Fri Dec 21 15:39:14 CET 2012


do you want to save the dataframe used in the plot and then the plot
itself?  If so consider using 'lattice' or 'ggplot2' which create an
object for "print" and this would allow you to use 'save' to save both
objects in a file.

If you want to generate the 'png' file, the you would have to 'save'
the dataframe and then 'zip' the .RData and png file into a new file.

So what is it that you intend to do with the data that is saved in the
common file?

On Fri, Dec 21, 2012 at 8:59 AM, Katherine Gobin
<katherine_gobin at yahoo.com> wrote:
> Dear R forum
>
> I have one stupid question, but I have no other solution to it in sight?
>
> Suppose some R process creates graphs etc alongwith main output as data.frame e.g
>
> output1 = data.frame(bands = c("A", "B", "C"), results = c(74, 108,  65))
>
> I normally save this output as some csv file.
>
> But I need to save this output as some image (I understand this is weird, but I need to find out some way to do so) e.g. for graph, I use 'png' as
>
> png("histogram.png", width=480,height=480)
>
> .....................
>
> ..................
>
> dev.off()
>
> Please advise.
>
> Regards
>
> Katherine
>
>
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.




More information about the R-help mailing list