How to add R code in an HTML page - html

I am creating a Twitter sentimental analysis and in the html page, I am giving a tab for looking at the Word Cloud. The Word Cloud code is in R. How do I integrate the R code into my HTML page. Any idea? Thanks.

You may have to use any server side languages like php and execute your R code with php shell_exec function and return this data to html using ajax.

Either call an external R-script from php or whatever language you are using (see: this thread) , and generate the images and html-code to be included with knitr or something similar.
Or try Rstudios shiny package to serve this part of the site directly from R.

Related

can html and c++ be linked without any external application?

i am working on a project which requires my c++ based code to run in a web page. taking the simplest example of "hello world" code in c++, is it possible to link this code to an html document, any help would be appreciated.
Scripting constraints: html/php/asp.net (asp.net only if this is not at all possible with html/php)
Actually, yes - provided your users are using chrome:
https://developer.chrome.com/native-client
Hacky, but working with yor constraints, is to make this "hello world" program output the whole html, and use it as a cgi. Or use php or asp to call this exec and redirect its output.
But this is not having the source code embedded in the html, like php does, but compiling the C++ to an executable and calling it from php. You can even extend php with c++.

Show the console output from R to be shown in an html page in an web application

I want to push user data back to R from a html page and then revert all the script output to another html page. I am also executing few shell scripts from the server so I am using cgi for the same. Is there a best practice for executing R and redirect figures and R-console output to html page.
Any help will be appreciated.
Thanks!
I can recommend you the package shiny.
Its very good for returning plots and tables, but not so much for R-concole output.
You can have a look here:
http://rstudio.github.io/shiny/tutorial/#hello-shiny

Generate dynamic html

to export some data i want to be able to generate an html output.
I have some constant content to output, like html headers and footers.
My question is how to deal with that ?
Do I have to embed some template (in a resource file) and parse it to make it dynamic ?
Do I store my static content in some constant (is there a 255 char limit?) and append them while generating the dynamic content ?
Do you have some hints, useful links, or best practices to share?
Thanks
Use the Delphi TPageProducer. It generates HTML from a 'close to HTML' template which contains special tage. You respond to these tag in an event and replace them with your own data. Works a treat.
I've created a Delphi project that handles this issue also. I wanted to create a web-platform that uses Delphi-code in the same source-files as the HTML, much like other web-scripting platforms, but still compiles a library to run. (and auto-compiles on changes)
http://xxm.sf.net/
In its basic form it compiles into library that can be run by a handler for IIS (ISAPI extension), InternetExplorer (IInternetProtocol as its own URL scheme), or a stand-alone HTTP process. (Apache module and FireFix plug-in are on the way).

Uploading file using HTML

Can anyone show me how to create an HTML page that allows to upload files?
It will be really appreciated.
File uploads cannot be done purely in HTML. You must have some kind of server logic to process the Multipart-data from the HTML-form (by using ASP.Net, PHP or whatever).
You can't do it in pure HTML, you need a script on server side to store the file.
If you can use PHP, check the manual on handling file uploads for details.
http://www.cs.tut.fi/~jkorpela/forms/file.html
You would need some server side componenet ot store the uploaded content for you.
There are near to infinite options for that. :)
Also, you have styled File uplaod components provided by various Ajax libraries and Tool kits like DOJO ,jQuery that make it look more nice and provide various flavors to do this.

SCHEME: how to input html and output it as html source?

I am trying to write a simple web app in scheme and I am using Drscheme for the job. I am wondering if there is a way to input html code into a form which then outputs it in html format (into source)? Is there a library that does the job? Everytime I input something it turns out as a string, I need it to be read as html. Can someone help me? Thanks in advance!
If you want to use HTML template files, then look at the templates in the web server manual. Also, in case you're not familiar with the web server, then see the web server guide for a good introduction.