Re: [R] Save R2HTML as an object instead of file

2010-12-01 Thread Eric Lecoutre
Hi Joel,

You can use:

obj=diag(3)
txt=capture.output(HTML(obj,file=""))

Then you may manipulate elements, paste with collapse argument, replace
parts with gsub and so on.

HTH,

Eric



2010/12/1 Joel 

>
> Hi
>
> Is it possible to instead of getting the HTML code written to a file, get
> it
> saved as a string in an object instead?
> Or is there any kind of package that can do this?
> //Joel
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Save-R2HTML-as-an-object-instead-of-file-tp3066776p3066776.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@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.
>



-- 
Eric Lecoutre
Consultant - Business & Decision
Business Intelligence & Customer Intelligence

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Save R2HTML as an object instead of file

2010-12-01 Thread Gregoire Pau

Hi Joel,

The function hwrite() of the package hwriter does that.
> library(hwriter)
> hwrite(iris[1:10,])

See examples at http://www.embl.de/~gpau/hwriter/

Cheers,

Greg
---
Gregoire Pau
EMBL Research Officer
http://www.embl.de/~gpau/

On 01/12/10 08:53, Joel wrote:


Hi

Is it possible to instead of getting the HTML code written to a file, get it
saved as a string in an object instead?
Or is there any kind of package that can do this?
//Joel


__
R-help@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.


Re: [R] Save R2HTML as an object instead of file

2010-12-01 Thread Joel

Or is there any kind of File buffer that dossent save a file on the
harddrive?

coz this gives me the thing I want but it still saves the file on the HD 

> .HTML.file=(temp<-file("era.html","w+"))
> HTML("NANALALA")
> HTML(diag(3))


Then I can just use

readLines(temp) to get the result

but as I said I dont want it to save the HTML on the HD just in an object.
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Save-R2HTML-as-an-object-instead-of-file-tp3066776p3066845.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.