An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110608/a7ad3c74/attachment.pl>
Can we prepare a questionaire in R
11 messages · Mike Marchywka, Matt Shotwell, Barry Rowlingson +3 more
----------------------------------------
Date: Wed, 8 Jun 2011 12:37:33 +0530 From: ammasamritha at gmail.com To: r-help at r-project.org Subject: [R] Can we prepare a questionaire in R Is there a way to prepare a questionnaire in R like html forms whose data can be directly populated into R?????
I've started to use Rapache although Rserve would also be an option.
When installed on server, your can point your html form to an rhtml
page and get the form variables in R just as with other web languages.
For writing html output, I had been using R2HTML ( see code excerpt below
from rhtml page). I had also found Cairo works ok if you don't
need X-11 for anything.
For your specific situation however, it may be easier to just
use whatever you already have and just use R for the data analysis.
When a request for a results report is made, send that to Rapache for
example. I would mention that I have gone to running two versions
of Apache, one with R and one with PHP, to allow for security and
easier development( I can write the php to fail nicely if the R apache
server is not up and no new security issues are exposed).
library("Cairo")
library("R2HTML")
library("RColorBrewer")
You can of course also generate html from normal R commands, or for that
matter bash scripts etc.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110608/60f1f71a/attachment.pl>
As Mike had written, there are frameworks for web-development with R. RApache http://www.rapache.net is one. Also, see the R package Rook: http://cran.r-project.org/web/packages/Rook/index.html .
On Wed, 2011-06-08 at 17:26 +0530, amrita gs wrote:
How can we create HTML forms in R????
Wouldn't you rather create HTML forms in HTML? See the links above to use R for server-side scripting, for example, to receive form data from a web browser.
[[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.
On Wed, Jun 8, 2011 at 12:56 PM, amrita gs <ammasamritha at gmail.com> wrote:
How can we create HTML forms in R????
HTML is Just Plain Text, so you can create them using R's text output
'cat' function. E.g.
cat('<form> First name: <input type="text" name="firstname" /><br
/>Last name: <input type="text" name="lastname" /></form>',
file="test.html")
and job done. Open test.html in your web browser and there it is.
Other packages may help you construct these things - search CRAN for
html, and also 'brewer' which is a handy package for making templates
which you can render into HTML.
But to be honest, your question is way too general as stated to get a
decent response here.
Barry
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110609/3aa9e0f8/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110609/1999427f/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110609/01871faf/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110609/6538f4cf/attachment.pl>
On Thu, Jun 9, 2011 at 11:09 AM, amrita gs <ammasamritha at gmail.com> wrote:
I will explain more clearly.... I have an online feedback form which has all the form elements like radiobuttons,checkboxes,textareas,textboxes etc. I have to get the values of these form elements and use it for data analysis in R. It will be huge amount of data. 1) Is it possible in R to retrieve the values of these form elements directly. 2) Is there any storage mechanism in R to store the values. 2) Do i have to store the data in some files or db and then import them in R and use for data analysis. Is this better?????
Are you analysing individual forms independently and giving rapid feedback? For example, a user puts some numbers in a box, clicks 'fit', and expects to see some parameters back and maybe a plot? Then you need R integrated with the server. Or are you doing summaries of many form submissions perhaps weekly or at the end of the study period? There's a problem with using R to store values coming from a web form - concurrency. Suppose two people submit the form at more or less the same time. If your web server back-end is using R to save the data you need to make sure the two processes aren't trying to write to the same file at the same time or you'll corrupt it. Databases such as Postgres sort this out by having clever locking mechanisms. If you are doing 'batch' analysis like this then you don't need R involved with the server at all, and things are much simpler. Just use a web server back end that suits you (java servlet, PHP, python web application framework) that takes the form data and adds it to a data base such as Postgres or MySQL. Then to do the analysis, R can get the data from such DBs and you can figure out how to produce your pie charts easily... You say you are a beginner in R, so best to leave it and use something else for the web side of things. What aren't you a beginner in? Barry
4 days later
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110614/55557be9/attachment.pl>