I am interested in writing a function where it takes a data frame as an input and returns an html page via knitr as an output based on the information in the data frame.
Here is sort of the psuedocode of the function that I wanted to write:
htmlOuput <- function(Df) {
newDf<-someManipulation(Df)
meltedDf<-melt(Df)
g<-ggplot(meltedDf)
return (html(g)) # This is the part that I am not sure about
}
Is there a way to output an html page as a function output via knitr ?
browseURL(tempfile(f = '.html'))gis a stored ggplot object, not a data.frame.gis a ggplot object, so I want the plot generated through ggplot rendered in the html file